Advertisement
Kuncavia

SumSeconds

Sep 14th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System;
  2. class SumSeconds
  3. {
  4.     static void Main(string[] args)
  5.     {
  6.         int num1 = int.Parse(Console.ReadLine());
  7.         int num2 = int.Parse(Console.ReadLine());
  8.         int num3 = int.Parse(Console.ReadLine());
  9.         int sec = num1 + num2 + num3;
  10.         int minutes = sec / 60;
  11.         sec = sec % 60;
  12.         Console.WriteLine("{0}:{1}", minutes, sec.ToString().PadLeft(2, '0'));
  13.  
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement