Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _02.Sudoku_Result
- {
- class Sudoku_Result
- {
- static void Main(string[] args)
- {
- string format;
- TimeSpan timeInterval = new TimeSpan(0,0,0);
- TimeSpan timeSum = new TimeSpan(0, 0, 0);
- CultureInfo culture;
- culture = CultureInfo.InvariantCulture;
- format = "mm\\:ss";
- string command = "";
- int counter = 1;
- while (command != "Quit")
- {
- timeInterval = TimeSpan.ParseExact(Console.ReadLine(), format, culture);
- command = Console.ReadLine();
- timeSum += timeInterval;
- counter++;
- }
- bool isGold = (timeSum.TotalSeconds) / counter < 720;
- if (isGold)
- {
- Console.WriteLine("Gold Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}",counter, Math.Floor(timeSum.TotalSeconds/ counter));
- }
- else if (timeSum.TotalSeconds / counter > 720 && timeSum.TotalSeconds / counter < 1440)
- {
- Console.WriteLine("Silver Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}", counter, Math.Floor(timeSum.TotalSeconds / counter));
- }
- else
- {
- Console.WriteLine("Bronze Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}", counter, Math.Floor(timeInterval.TotalSeconds / counter));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement