Advertisement
fbinnzhivko

10. Centuries to Nanoseconds

May 19th, 2016
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2. class CenturiesToNanosec
  3. {
  4.     static void Main()
  5.     {
  6.         int centuries = int.Parse(Console.ReadLine());
  7.         int years = centuries * 100;
  8.         int days = (int)(years * 365.2422);
  9.         int hours = days * 24;
  10.         decimal minutes = hours * 60M;
  11.         decimal seconds = minutes * 60M;
  12.         decimal milliseconds = seconds * 1000M;
  13.         decimal microseconds = milliseconds * 1000;
  14.         decimal nanoseconds = microseconds * 1000;
  15.         Console.WriteLine("{0} centuries = {1} years = {2} days = {3} hours = {4} minutes = {5} seconds = {6} milliseconds = {7} microseconds = {8} nanoseconds", centuries, years, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement