Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03._Sum_Seconds
- {
- class Program
- {
- static void Main(string[] args)
- {
- int firstTime = int.Parse(Console.ReadLine());
- int secondTime = int.Parse(Console.ReadLine());
- int thirdTime = int.Parse(Console.ReadLine());
- int sumSeconds = firstTime + secondTime + thirdTime; //сумарно време в секунди
- int minutes = sumSeconds / 60;
- int seconds = sumSeconds % 60; //едноцифрени или двуцифрени
- Console.WriteLine($"{minutes}:{seconds:D2}");
- /* if (seconds < 10)
- {
- //минути:0секунди
- Console.WriteLine($"{minutes}:0{seconds}");
- }
- else //seconds >= 10
- {
- //минути:секунди
- Console.WriteLine($"{minutes}:{seconds}");
- }*/
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment