Advertisement
Guest User

10

a guest
May 26th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 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. int centuries = int.Parse(Console.ReadLine());
  11.  
  12. int years = centuries * 100;
  13. double days = years * 365.2422;
  14. decimal hours = (int)days * 24;
  15. decimal minutes = hours * 60;
  16. long seconds = (long)minutes * 60;
  17. long milliseconds = seconds * 1000;
  18. long microseconds = milliseconds * 1000;
  19. BigInteger nanoseconds = (BigInteger)microseconds * 1000;
  20.  
  21. Console.WriteLine($"{centuries} centuries = {years} years " +
  22. $"= {(int)days} days = {hours} hours = {minutes} minutes = {seconds} seconds " +
  23. $"= {milliseconds} milliseconds = {microseconds} microseconds = {nanoseconds} nanoseconds");
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement