Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n = int.Parse(Console.ReadLine());
- Student[] allStudents = new Student[n];
- for (int i = 1; i <= n; i++)
- {
- string input = Console.ReadLine();
- string[] arr = input
- .Split(' ', StringSplitOptions.RemoveEmptyEntries);
- string name = arr[0];
- Student student = new Student(name);
- for (int j = 1; j < arr.Length; j++)
- {
- double current = double.Parse(arr[j]);
- Grade grage = new Grade(current);
- student.Grades.Add(grage);
- }
- allStudents[i - 1] = student;
- }
- foreach(var stud in allStudents.OrderBy(s => s.Name).ThenByDescending(s => s.GardesAverage))
- {
- if(stud.GardesAverage >= 5.00)
- {
- Console.WriteLine($"{stud.Name} -> {stud.GardesAverage:f2}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement