nvnnaidenov

SumSeconds - School Book 3.0

Jul 27th, 2021
991
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. class SumSeconds
  4. {
  5.     static void Main()
  6.     {
  7.         int firstCompetitor = int.Parse(Console.ReadLine());
  8.         int secondCompetitor = int.Parse(Console.ReadLine());
  9.         int thirdCompetitor = int.Parse(Console.ReadLine());
  10.  
  11.         int seconds = firstCompetitor + secondCompetitor + thirdCompetitor;
  12.         int minutes = 0;
  13.  
  14.         if(seconds > 59)
  15.         {
  16.             minutes++;
  17.             seconds = seconds - 60;
  18.         }
  19.  
  20.         if (seconds > 59)
  21.         {
  22.             minutes++;
  23.             seconds = seconds - 60;
  24.         }
  25.  
  26.         if (seconds < 10)
  27.         {
  28.             Console.WriteLine(minutes + ":" + "0" + seconds);
  29.         }
  30.         else
  31.         {
  32.             Console.WriteLine(minutes + ":" + seconds);
  33.         }
  34.     }
  35. }
  36.  
RAW Paste Data