Advertisement
knikolov98

Untitled

Sep 21st, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace seconds_calc
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int time1 = int.Parse(Console.ReadLine());
  10.             int time2 = int.Parse(Console.ReadLine());
  11.             int time3 = int.Parse(Console.ReadLine());
  12.  
  13.             int totaltime = time1 + time2 + time3;
  14.  
  15.             int minutes = totaltime / 60;
  16.             int seconds = totaltime % 60;
  17.  
  18.             if (seconds < 10)
  19.  
  20.             {
  21.                 Console.WriteLine("{0}:0{1}", minutes, seconds);
  22.             }
  23.  
  24.             else
  25.  
  26.             {
  27.                 Console.WriteLine("{0}:{1}", minutes, seconds);
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement