Advertisement
ivanov_ivan

SudokuTeoRedacted100/100

Feb 18th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.49 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 Sudoku_Results
  8. {
  9.     static void Main(string[] args)
  10.     {
  11.         //31.ProgBasicsExam_8_November2015
  12.  
  13.         //Sudoku_Results
  14.  
  15.         string[] format = Console.ReadLine().Split(':');
  16.  
  17.         double mm = 0.0D;
  18.         double ss = 0.0D;
  19.  
  20.         double minutes = 0.0D;
  21.         double sum = 0.0D;
  22.         double counter = 0;
  23.  
  24.         string word = string.Empty; // Не е нужно
  25.  
  26.         while (format[0] != "Quit")
  27.         {
  28.             mm = double.Parse(format[0]);
  29.             ss = double.Parse(format[1]);
  30.             minutes = mm * 60;
  31.             sum += minutes + ss;
  32.             counter++;
  33.             format = Console.ReadLine().Split(':');
  34.         }
  35.  
  36.         bool isGold = (sum) / counter < 720;
  37.  
  38.         if (isGold)
  39.         {
  40.             Console.WriteLine("Gold Star");
  41.             Console.WriteLine("Games - {0} \\ Average seconds - {1}", counter, Math.Ceiling(sum / counter));
  42.         }
  43.  
  44.         else if (sum / counter > 720 && sum / counter < 1440)
  45.         {
  46.             Console.WriteLine("Silver Star");
  47.             Console.WriteLine("Games - {0} \\ Average seconds - {1}", counter, Math.Ceiling(sum / counter));
  48.         }
  49.         else
  50.         {
  51.             Console.WriteLine("Bronze Star");
  52.             Console.WriteLine("Games - {0} \\ Average seconds - {1}", counter, Math.Ceiling(sum / counter));
  53.         }
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement