Advertisement
martinvalchev

Centuries_to_Nanoseconds

Jan 31st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Centuries_to_Nanoseconds
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             byte century = byte.Parse(Console.ReadLine());
  10.             short years = (short)(century * 100);
  11.             int days = (int)(years * 365.2422);
  12.             int hours = days * 24;
  13.             ulong mins = (ulong)hours * 60;
  14.             long secs = (long)mins * 60;
  15.             ulong milis = (ulong)secs * 1000;
  16.             decimal micro = (decimal)milis * 1000;
  17.             decimal nano = (decimal)micro * 1000;
  18.  
  19.             Console.WriteLine($"{century} centuries = {years} years = {days} days = {hours} hours = {mins} minutes = {secs} seconds = {milis} milliseconds = {micro} microseconds = {nano} nanoseconds");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement