Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- int sec1 = int.Parse(Console.ReadLine());
- int sec2 = int.Parse(Console.ReadLine());
- int sec3 = int.Parse(Console.ReadLine());
- int secs = sec1 + sec2 + sec3;
- int mins = (sec1 + sec2 + sec3) / 60;
- if (secs >= 0 && secs <= 59)
- {
- if (secs < 10)
- {
- Console.WriteLine("{0}:0{1}", mins, secs);
- }
- else
- {
- Console.WriteLine("{0}:{1}", mins, secs);
- }
- }
- else if (secs >= 60 && secs <= 119)
- {
- secs = secs - 60;
- if (secs < 10)
- {
- Console.WriteLine("{0}:0{1}", mins, secs);
- }
- else
- {
- Console.WriteLine("{0}:{1}", mins, secs);
- }
- }
- else if (secs >= 120 && secs <= 179)
- {
- secs = secs - 120;
- if (secs < 10)
- {
- Console.WriteLine("{0}:0{1}", mins, secs);
- }
- else
- {
- Console.WriteLine("{0}:{1}", mins, secs);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement