Advertisement
fbinnzhivko

Sudoku results

Apr 22nd, 2016
127
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. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         string inputString = Console.ReadLine();
  7.  
  8.         int counter = 0, sum = 0;
  9.         double average = 0;
  10.  
  11.         while (inputString != "Quit")
  12.         {
  13.             sum += int.Parse(inputString.Substring(0, 2)) * 60 + int.Parse(inputString.Substring(3, 2));
  14.             counter++;
  15.  
  16.             inputString = Console.ReadLine();
  17.         }
  18.         average = Math.Ceiling((double)sum / counter);
  19.  
  20.  
  21.         if (average < 720)
  22.         {
  23.             Console.WriteLine("Gold Star\nGames - {0} \\ Average seconds - {1}", counter, average);
  24.         }
  25.         else if (average >= 720 && average <= 1440)
  26.         {
  27.             Console.WriteLine("Silver Star\nGames - {0} \\ Average seconds - {1}", counter, average);
  28.         }
  29.         else if (average > 1440)
  30.         {
  31.             Console.WriteLine("Bronze Star\nGames - {0} \\ Average seconds - {1}", counter, average);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement