Advertisement
tandaleyo

Sudoku Results

Nov 24th, 2015
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. class SudokuResults
  8. {
  9. static void Main()
  10. {
  11.  
  12. string input = Console.ReadLine();
  13. double minutes = 0D;
  14. double seconds = 0D;
  15. int counter = 0;
  16.  
  17.  
  18. while (input != "Quit")
  19. {
  20. string[] time = input.Split(':');
  21. minutes = minutes + Double.Parse(time[0]);
  22. seconds = seconds + Double.Parse(time[1]);
  23. counter++;
  24.  
  25. input = Console.ReadLine();
  26. }
  27.  
  28. double totalTime = minutes * 60 + seconds;
  29. double avgTime = totalTime / counter;
  30.  
  31. if (avgTime > 1440)
  32. {
  33. Console.WriteLine("Bronze Star");
  34. Console.WriteLine("Games - {0} \\ Average seconds - {1:F0}", counter, Math.Ceiling(avgTime));
  35. }
  36. else if (avgTime > 720 && avgTime < 1440)
  37. {
  38. Console.WriteLine("Sliver Star");
  39. Console.WriteLine("Games - {0} \\ Average seconds - {1:F0}", counter, Math.Ceiling(avgTime));
  40. }
  41. else if (avgTime < 720)
  42. {
  43. Console.WriteLine("Gold Star");
  44. Console.WriteLine("Games - {0} \\ Average seconds - {1:F0}", counter, Math.Ceiling(avgTime));
  45. }
  46.  
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement