bacco

Задача: сумиране на секунди

Jan 18th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. namespace DDDDDDDDDDDDDDDDDDDDDD
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             int firstCompetitor = int.Parse(Console.ReadLine());
  11.             int secondCompetitor = int.Parse(Console.ReadLine());
  12.             int threeCompetitor = int.Parse(Console.ReadLine());
  13.  
  14.             int totalSeconds = firstCompetitor + secondCompetitor + threeCompetitor;
  15.  
  16.             int minutes = totalSeconds / 60;
  17.             int seconds = totalSeconds % 60;
  18.  
  19.             if (seconds < 10)
  20.             {
  21.                 Console.WriteLine(minutes + ":0" + seconds);
  22.             }
  23.             else
  24.             {
  25.                 Console.WriteLine((minutes + ":" + seconds));
  26.             }
  27.  
  28.  
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment