Pretorianbg

sumseconds

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