Advertisement
plamen27

centToNanosecs fixed

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