Advertisement
ramsess

Untitled

Feb 25th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. int inputCount = 0;
  2.             int averageSeconds = 0;
  3.             DateTime data;
  4.             string data_string;
  5.             string[] stars = {
  6.                 "Gold star",
  7.                 "Silver star",
  8.                 "Bronze star"
  9.             };
  10.             data_string = Console.ReadLine ();
  11.             do {
  12.                 data = DateTime.ParseExact (data_string, "mm:ss", CultureInfo.InvariantCulture);
  13.                 inputCount++;
  14.                 averageSeconds = data.Minute * 60 + data.Second;
  15.                 data_string = Console.ReadLine ();
  16.             } while (data_string != "Quit");
  17.             {
  18.                 if (averageSeconds < 720) {
  19.                     Console.WriteLine (stars [0]);
  20.                 } else if (averageSeconds >= 720 && averageSeconds < 1440) {
  21.                     Console.WriteLine (stars [1]);
  22.                 } else {
  23.                     Console.WriteLine (stars [2]);
  24.                 }
  25.                 Console.WriteLine ("Games - {0} {2} Average seconds {1}", inputCount, averageSeconds, new string ('\u005C', 1));
  26.                 return;
  27.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement