Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace BakingCompetition
- {
- class BakingCompetition
- {
- static void Main(string[] args)
- {
- var kozunak = int.Parse(Console.ReadLine());
- string comand = "";
- string bakerWinner = "";
- int winnerScore = 0;
- for (int i = 0; i < kozunak; i++)
- {
- string bakerName = Console.ReadLine();
- int currentScore = 0;
- while ((comand = Console.ReadLine()) != "Stop")
- {
- int grade = int.Parse(comand);
- currentScore += grade;
- }
- if (currentScore > winnerScore)
- {
- bakerWinner = bakerName;
- winnerScore = currentScore;
- }
- }
- Console.WriteLine($"winnerBaker {bakerWinner}");
- Console.WriteLine($"winnerScore {winnerScore}");
- }
- }
- }
Add Comment
Please, Sign In to add comment