Advertisement
Alexander_B

Sum Seconds

Jan 27th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DomashnoSumSeconds
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int TimeFirst = int.Parse(Console.ReadLine());
  14. int TimeSecond = int.Parse(Console.ReadLine());
  15. int TimeThird = int.Parse(Console.ReadLine());
  16. int TotalTime = TimeFirst + TimeSecond + TimeThird;
  17. int Minutes = TotalTime / 60;
  18. int Seconds = TotalTime % 60;
  19. if (Seconds < 10)
  20. {
  21. Console.WriteLine($"{Minutes}:0{Seconds}");
  22. }
  23. else
  24. {
  25. Console.WriteLine($"{Minutes}:{Seconds}");
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement