Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int firstCompetitor = int.Parse(Console.ReadLine());
- int secondCompetitor = int.Parse(Console.ReadLine());
- int thirdCompetitor = int.Parse(Console.ReadLine());
- int seconds = firstCompetitor + secondCompetitor + thirdCompetitor;
- int minutes = 0;
- if (seconds <= 59)
- {
- minutes = 0;
- seconds = seconds;
- } else if (seconds > 59 && seconds <= 119)
- {
- minutes++;
- seconds = seconds - 60;
- } else if (seconds > 119 && seconds <= 179)
- {
- minutes += 2;
- seconds = seconds - 120;
- }
- if (seconds < 10)
- {
- Console.WriteLine(minutes + ":" + "0" + seconds);
- } else
- {
- Console.WriteLine(minutes + ":" + seconds);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment