Advertisement
tochka

Untitled

Oct 6th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 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.  
  7. namespace _10.Centuries_to_Nanoseconds
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int centuries = int.Parse(Console.ReadLine());
  14. int toYears = centuries * 100;
  15. int toDays = (int)(toYears * 365.2422);
  16. int toHours = toDays * 24;
  17. int toMinutes = toHours * 60;
  18. long toSeconds = (long)toMinutes * 60;
  19. long toMilliSeconds = (long)toSeconds * 1000;
  20. long toMicroSeconds = (long)toMilliSeconds * 1000;
  21. decimal toNanoSecons = (decimal)toMicroSeconds * 1000;
  22.  
  23. Console.WriteLine($"{centuries} centuries = {toYears} years = {toDays} days = {toHours} hours = {toMinutes} minutes = {toSeconds} seconds = {toMilliSeconds} milliseconds = {toMicroSeconds} microseconds = {toNanoSecons} nanoseconds");
  24.  
  25.  
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement