Guest User

Untitled

a guest
Nov 18th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 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 Sum_Seconds
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int time1 = int.Parse(Console.ReadLine());
  14. int time2 = int.Parse(Console.ReadLine());
  15. int time3 = int.Parse(Console.ReadLine());
  16.  
  17. int time = time1 + time2 + time3;
  18.  
  19. if (time >= 0 && time <= 59)
  20. {
  21. Console.WriteLine("0:0" + time);
  22. }
  23. else if (time >= 60 && time <= 119)
  24.  
  25. {
  26. Console.WriteLine("1:0" + (time - 60));
  27. }
  28. else if (time >= 120 && time <= 179)
  29.  
  30. {
  31. Console.WriteLine("2:0" + (time - 120));
  32. }
  33. else if (time < 10)
  34. {
  35. Console.WriteLine("0:0"+time);
  36. }
  37.  
  38. }
  39. }
  40. }
Add Comment
Please, Sign In to add comment