Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- namespace myloyorrr
- {
- class Program
- {
- struct Depositors
- {
- public string Surname, Name, SecName;
- public int Number, Amount, Year;
- public Depositors(string Surname, string Name, string SecName, int Number, int Amount, int Year)
- {
- this.Name = Name;
- this.Surname = Surname;
- this.SecName = SecName;
- this.Number = Number;
- this.Amount = Amount;
- this.Year = Year;
- }
- }
- static void Main()
- {
- using (StreamReader sr = new StreamReader("C:/Настя/книит/in.txt"))
- {
- using (StreamWriter sw = new StreamWriter("C:/Настя/книит/out.txt"))
- {
- int n = int.Parse(sr.ReadLine());
- Depositors[] array = new Depositors[n];
- for (int i = 0; i < n; i++)
- {
- string[] text = sr.ReadLine().Split(' ');
- array[i] = new Depositors(text[0], text[1], text[2], int.Parse(text[3]), int.Parse(text[4]), int.Parse(text[5]));
- }
- int year = int.Parse(sr.ReadLine());
- var depos =
- from x in array
- where x.Year == year
- orderby x.Amount
- select x;
- foreach (var x in depos)
- {
- sw.WriteLine("{0} {1} {2}, {3}, {4}, {5}", x.Surname, x.Name, x.SecName, x.Number, x.Amount, x.Year);
- }
- }
- }
- }
- }
- }
- 7
- Мыльникова Анастасия Сергеевна 8 88888 2023
- Уталиев Султан Едильбаевич 17 100000 2021
- Стародубцев Иван Денисович 16 777777 2020
- Алексеева Ксения Михайловна 13 55555 2023
- Ложкова Александра Геннадьевна 9 99999 2023
- Шилина Ангелина Артуровна 10 99999 2023
- Певнева Валерия Александровна 11 90000 2023
- 2023
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement