Advertisement
ramsess

Sudoku_Results

Feb 25th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Sudoku_Results
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main (string[] args)
  8.         {
  9.             TimeSpan TS = new TimeSpan ();
  10.  
  11.             int count_game = 0;
  12.             int Second = 0;
  13.             int Average_seconds = 0;
  14.             string k = Console.ReadLine ();
  15.             do {
  16.                 int mm = Convert.ToInt32(k.Substring (0, k.IndexOf(':')));
  17.                 int ss = Convert.ToInt32(k.Substring (k.IndexOf(':') + 1, 2));
  18.                 TimeSpan LTS = new TimeSpan(0,(int)mm,(int)ss);
  19.                 TS = TS.Add(LTS);
  20.                 k = Console.ReadLine ();
  21.                 count_game++;
  22.             } while (k != "Quit");
  23.             Average_seconds = Convert.ToInt32(Math.Ceiling(TS.TotalSeconds / count_game));
  24.  
  25.             if (Average_seconds < 720) {
  26.                 Console.WriteLine ("Gold Star");
  27.             } else if (Average_seconds >= 720 && Average_seconds < 1440) {
  28.                 Console.WriteLine ("Silver Star");
  29.             } else {
  30.                 Console.WriteLine ("Bronze Star");
  31.             }
  32.  
  33.             Console.WriteLine ("Games - {0} \\ Average seconds - {1}", count_game, Average_seconds);
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement