Advertisement
DaniPasteBin

Untitled

May 29th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace _10.CenturiesToNanoseconds
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.  
  11.             int centuries = int.Parse(Console.ReadLine());
  12.             int years = centuries * 100;
  13.             int days = (int)(years * 365.2422);
  14.             int hours = (days * 24);
  15.             int minutes = hours * 60;
  16.             long seconds = minutes * 60L;
  17.             long milliseconds = seconds * 1000;
  18.             ulong microseconds = (ulong)milliseconds * 1000;
  19.             BigInteger nanoseconds = microseconds*BigInteger.Parse("1000"); //горе дописвам using System.Numerics; и променливата ми се разпознава
  20.  
  21.             Console.Write("{0} centuries = ", centuries);
  22.             Console.Write("{0} years = ", years);
  23.             Console.Write("{0} days = ", days);
  24.             Console.Write("{0} hours = ", hours);
  25.             Console.Write("{0} minutes = ", minutes);
  26.             Console.Write("{0} seconds = ", seconds);
  27.             Console.Write("{0} milliseconds = ", milliseconds);
  28.             Console.Write("{0} microseconds = ", microseconds);
  29.             Console.Write("{0} nanoseconds", nanoseconds);
  30.            
  31.  
  32.  
  33.  
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement