Advertisement
kallyy7

Untitled

Feb 27th, 2018
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 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.  
  7. namespace _02.Airplane
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int hour = int.Parse(Console.ReadLine());
  14.             int minute = int.Parse(Console.ReadLine());
  15.             int polet = int.Parse(Console.ReadLine());
  16.  
  17.             int time = (hour * 60) + minute;
  18.             int kacane = time + polet;
  19.             int minTime = kacane % 60;
  20.             int hourTime = kacane / 60;
  21.             if(hourTime >= 24)
  22.             {
  23.                 hourTime -= 24;
  24.             }
  25.             Console.WriteLine($"{hourTime}h {minTime}m");
  26.  
  27.  
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement