Advertisement
IvanITD

01.SumSeconds

Jan 15th, 2024
648
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | Source Code | 0 0
  1. int firstTime = int.Parse(Console.ReadLine());
  2. int secondTime = int.Parse(Console.ReadLine());
  3. int thirdTime = int.Parse(Console.ReadLine());
  4.  
  5. int totalTime = firstTime + secondTime + thirdTime;
  6.  
  7. int timeInMinutes = totalTime / 60;
  8. int timeInSeconds = totalTime % 60;
  9.  
  10. Console.WriteLine($"{timeInMinutes}:{timeInSeconds:D2}");
Tags: C#
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement