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 SudokuResults
- {
- class SudokuResults
- {
- static void Main()
- {
- string[] input = Console.ReadLine().Split(':');
- double minutesConvertedToSeconds;
- double seconds;
- double totalSeconds = 0;
- double countOfGames = 0;
- while (input[0] != "Quit")
- {
- minutesConvertedToSeconds = double.Parse(input[0]) * 60;
- seconds = double.Parse(input[1]);
- totalSeconds += minutesConvertedToSeconds + seconds;
- countOfGames++;
- input = Console.ReadLine().Split(':');
- }
- double avarageSeconds = Math.Ceiling(totalSeconds / countOfGames);
- if (avarageSeconds < 720 && avarageSeconds >= 0)
- {
- Console.WriteLine("Gold Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}",countOfGames,avarageSeconds);
- }
- else
- {
- if (avarageSeconds >= 720 && avarageSeconds <= 1440 )
- {
- Console.WriteLine("Silver Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}", countOfGames, avarageSeconds);
- }
- else if (avarageSeconds > 1440)
- {
- Console.WriteLine("Bronze Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}", countOfGames, avarageSeconds);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement