skipter

Second Sum - C# Basics

May 21st, 2017
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 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. namespace ConsoleApp4
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int firstTime = int.Parse(Console.ReadLine());
  13.             int secondTime = int.Parse(Console.ReadLine());
  14.             int thurdTime = int.Parse(Console.ReadLine());
  15.             int sum = firstTime + secondTime + thurdTime;
  16.             int minutes = sum / 60;
  17.             int seconds = sum % 60;
  18.  
  19.             Console.WriteLine("{0}:{1:00}", minutes, seconds);
  20.  
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment