Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Задача_6.Великденски_конкурс
- {
- class Program
- {
- static void Main(string[] args)
- {
- var numKozunak = int.Parse(Console.ReadLine());
- int max = 0;
- string winer = "";
- for (int i = 0; i < numKozunak; i++)
- {
- string pekar = Console.ReadLine();
- string comand= Console.ReadLine();
- int sum = 0;
- while (comand!="Stop")
- {
- int ocenka = int.Parse(comand);
- sum += ocenka;
- comand = Console.ReadLine();
- }
- Console.WriteLine($"{pekar} has {sum} points.");
- if (sum>max)
- {
- max = sum;
- winer = pekar;
- Console.WriteLine($"{pekar} is the new number 1!");
- }
- }
- Console.WriteLine($"{winer} won competition with {max} points!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement