Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03.Time___15_Minutes
- {
- class Program
- {
- static void Main(string[] args)
- {
- //1. Четем отконзолата времето на 3-мата състезатели (сек.)
- int first = int.Parse(Console.ReadLine());
- int second = int.Parse(Console.ReadLine());
- int third = int.Parse(Console.ReadLine());
- //2. Намираме общото време в сек
- int totalTime = first + second + third;
- //3. Намираме колко минути и колко сек е общото време
- int min = totalTime / 60;
- int sec = totalTime % 60;
- //4. Отпечатваме резултата на конзолата (мин:сек => сек<10 => 0{сек})
- if (sec<10)
- {
- Console.WriteLine($"{min}:0{sec}");
- }
- else
- {
- Console.WriteLine($"{min}:{sec}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement