Guest User

Untitled

a guest
Sep 19th, 2016
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 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. using System.Numerics;
  7.  
  8. namespace _20.CenturiesToNanoseconds
  9. {
  10.     class CenturiesToNanoseconds
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int centuries = int.Parse(Console.ReadLine());
  15.             int years = 100 * centuries;
  16.             int days = (int)(years * 365.2422);
  17.             ulong hours = (ulong)(24 * days);
  18.             BigInteger minutes = 60 * hours;
  19.             BigInteger seconds = 60 * minutes;
  20.             BigInteger milliseconds = 1000 * seconds;
  21.             BigInteger microseconds = 1000 * milliseconds;
  22.             BigInteger nanoseconds = 1000 * microseconds;
  23.  
  24.             Console.WriteLine($"{centuries} centuries = {years} years = {days} days = {hours} hours = {minutes} minutes = {seconds} seconds = {milliseconds} milliseconds = {microseconds} microseconds = {nanoseconds} nanoseconds");
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment