Advertisement
Vladimir76

Centurioes to nanoseconds

Jan 22nd, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Numerics;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Centuries_to_Nanoseconds
  9. {
  10.     class Program
  11.     {
  12.         static void Main()
  13.         {
  14.             int centuries = int.Parse(Console.ReadLine());
  15.  
  16.             int years = centuries * 100;
  17.             ulong day = (ulong)(years*365.2422);
  18.             ulong hours = day * 24;
  19.             ulong minutes = hours * 60;
  20.             ulong seconds = minutes * 60;
  21.             ulong milliSeconds = seconds * 1000;
  22.             BigInteger microSeconds = milliSeconds * 1000;
  23.             BigInteger nanoSeconds = microSeconds * 1000;
  24.  
  25.             Console.WriteLine(
  26.                 "{0} centuries = {1} years = {2} days = {3} hours = {4} minutes = {5} seconds = {6} milliseconds = {7} microseconds = {8} nanoseconds",
  27.                 centuries,years,day,hours,minutes,seconds,milliSeconds,microSeconds,nanoSeconds);
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement