VelizarAvramov

10. Centuries to Nanoseconds

Nov 15th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace Demo
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int centures = int.Parse(Console.ReadLine());
  11.  
  12.             short years = (short)(centures * 100);
  13.             int days = (int)(years * 365.2422);
  14.             int hours = days * 24;
  15.             int minutes = hours * 60;
  16.             ulong seconds = (ulong)minutes * 60;
  17.             BigInteger milisec = seconds * 1000;
  18.             BigInteger microsec = milisec * 1000;
  19.             BigInteger nanosec = microsec * 1000;
  20.  
  21.             Console.WriteLine($"{centures} centuries = {years} years = {days} days = {hours} hours = {minutes} minutes = {seconds} seconds = {milisec} milliseconds = {microsec} microseconds = {nanosec} nanoseconds");
  22.  
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment