Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06._Easter_Competition
- {
- class Program
- {
- public static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- string chef = "";
- int maxscore = 0;
- for (int i = 0; i < n; i++)
- {
- string name = Console.ReadLine();
- string score = Console.ReadLine();
- int sum = 0;
- while (score != "Stop")
- {
- sum += int.Parse(score);
- score = Console.ReadLine();
- }
- Console.WriteLine(name + " has " + sum + " points.");
- if (sum > maxscore)
- {
- maxscore = sum;
- chef = name;
- Console.WriteLine(name + " is the new number 1!");
- }
- }
- Console.WriteLine(chef + " won competition with " + maxscore + " points!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement