Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace chjdrfehrd
- {
- class samka
- {
- const int normative = 80;
- public string famile, gr, prepod;
- public bool normat;
- public int rez;
- public samka()
- {
- Console.Write ("фамилия: ");
- this.famile = Console.ReadLine ();
- Console.Write ("группа: ");
- this.gr = Console.ReadLine ();
- Console.Write ("препод: ");
- this.prepod = Console.ReadLine ();
- Console.Write ("результат: ");
- this.rez =int.Parse (Console.ReadLine ());
- if (rez > normative)
- normat = true;
- else
- normat = false;
- }
- }
- class MainClass
- {
- public static void Main (string[] args)
- {
- Console.Write ("Количество участниц: ");
- int count = int.Parse (Console.ReadLine ());
- samka[] kross = new samka[count];
- for (int i = 0; i < kross.Length; i++)
- {
- Console.WriteLine ("Введите данные {0}-й самки", i + 1);
- kross [i] = new samka ();
- }
- for (int i = 0; i < kross.Length; i++)
- {
- for (int j = i + 1; j < kross.Length; j++)
- {
- if (kross [i].rez > kross [j].rez)
- {
- samka temp = kross [i];
- kross [i] = kross [j];
- kross [j] = temp;
- }
- }
- }
- for (int i = 0; i < kross.Length; i++)
- {
- Console.WriteLine ("samka: {0} \t group: {1} \t prepod: {2} \t rezult: {3} \t sdal: {4} \n", kross [i].famile, kross [i].gr, kross [i].prepod, kross [i].rez, kross [i].normat);
- }
- Console.ReadKey ();
- Console.Read ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement