Advertisement
dragonbs

SumSeconds

Oct 22nd, 2022
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01.SumSeconds
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int first = int.Parse(Console.ReadLine());
  10.             int second = int.Parse(Console.ReadLine());
  11.             int third = int.Parse(Console.ReadLine());
  12.  
  13.             int time = first + second + third;
  14.  
  15.             int minutes = time / 60;
  16.             int seconds = time % 60;
  17.  
  18.             if (seconds>=10)
  19.             {
  20.                 Console.WriteLine($"{minutes}:{seconds}");
  21.             }
  22.             else
  23.             {
  24.                 Console.WriteLine($"{minutes}:0{seconds}");
  25.             }
  26.         }
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement