Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Input
- int firstPlayerTime = int.Parse(Console.ReadLine());
- int secondPlayerTime = int.Parse(Console.ReadLine());
- int thirdPlayerTime = int.Parse(Console.ReadLine());
- //Calculations
- int timeInSeconds = firstPlayerTime + secondPlayerTime + thirdPlayerTime;
- int minutes = timeInSeconds / 60;
- int seconds = timeInSeconds % 60;
- //Output
- if (seconds < 10)
- {
- Console.WriteLine($"{minutes}:0{seconds}");
- }
- else
- {
- Console.WriteLine($"{minutes}:{seconds}");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement