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.Numerics;
- using System.Text;
- using System.Threading.Tasks;
- using System.Threading;
- namespace Test
- {
- class ThreeEqualNumber
- {
- static void Main()
- {
- string format;
- TimeSpan timeInterval = new TimeSpan(0 , 0 , 0);
- TimeSpan timeSum = new TimeSpan(0 , 0 , 0);
- //CultureInfo culture;
- //culture = CultureInfo.InvariantCulture;
- //Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- format = "mm\\:ss";
- string command = Console.ReadLine();
- int counter = 1;
- while(command != "Quit")
- {
- timeInterval = TimeSpan.ParseExact(command , format , null);
- timeSum += timeInterval;
- counter++;
- command = Console.ReadLine();
- }
- bool isGold = ( timeSum.TotalSeconds ) / counter < 720;
- if(isGold)
- {
- Console.WriteLine("Gold Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}" , counter , Math.Ceiling(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.Ceiling(timeSum.TotalSeconds / counter));
- }
- else
- {
- Console.WriteLine("Bronze Star");
- Console.WriteLine("Games - {0} \\ Average seconds - {1}" , counter , Math.Ceiling(timeInterval.TotalSeconds / counter));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement