Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- namespace P10_CenturiesToNanosecond
- {
- class Program
- { // 365.2422
- static void Main(string[] args)
- {
- byte centuries = byte.Parse(Console.ReadLine());
- ushort years = (ushort)(centuries * 100);
- int days = (int)(years * 365.2422);
- int hours = days * 24;
- long minutes = (long)hours * 60;
- long seconds = minutes * 60;
- ulong miliseconds = (ulong)seconds * 1000;
- BigInteger microseconds = (BigInteger)miliseconds * 1000;
- BigInteger nanoseconds = microseconds * 1000;
- Console.WriteLine($"{centuries} centuries = {years} years = {days} days = {hours} hours = {minutes}" +
- $" minutes = {seconds} seconds = {miliseconds} milliseconds = {microseconds} microseconds = {nanoseconds} nanoseconds");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment