Advertisement
-Annie-

EXAM*01.SinoTheWalker

Jul 6th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. namespace Exam
  2. {
  3.     using System;
  4.     using System.Linq;
  5.  
  6.     public class SinoTheWalker
  7.     {
  8.         static void Main()
  9.         {
  10.             var nums = Console.ReadLine().Split(':').Select(int.Parse).ToArray();
  11.             long seconds = nums[2] + 60 * nums[1] + 3600 * nums[0];
  12.             long secondsToAdd = long.Parse(Console.ReadLine()) * long.Parse(Console.ReadLine());
  13.             seconds += secondsToAdd;
  14.             var secs = seconds % 60;
  15.             var mins = (seconds / 60) % 60;
  16.             var hours = (seconds / 60 / 60) % 24;
  17.  
  18.             Console.WriteLine("Time Arrival: {0:d2}:{1:d2}:{2:d2}", hours, mins, secs);
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement