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 EasterCompetition
- {
- class Program
- {
- static void Main(string[] args)
- {
- double EasterBreadNum = double.Parse(Console.ReadLine());
- string bakerName = string.Empty;
- double maxPoints = 0;
- string bestBaker = string.Empty;
- for (int i = 1; i <= EasterBreadNum; i++)
- {
- bakerName = Console.ReadLine();
- string assessment = string.Empty;
- double currentPoints = 0;
- while (assessment != "Stop")
- {
- assessment = Console.ReadLine();
- if (assessment == "Stop")
- {
- assessment = string.Empty;
- break;
- }
- currentPoints += double.Parse(assessment);
- }
- Console.WriteLine($"{bakerName} has {currentPoints} points.");
- if (currentPoints > maxPoints)
- {
- maxPoints = currentPoints;
- bestBaker = bakerName;
- Console.WriteLine($"{bestBaker} is the new number 1!");
- }
- }
- Console.WriteLine($"{bestBaker} won competition with {maxPoints} points!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement