Anzzhhela98

Untitled

Jun 18th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TomCat_2
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int freeDays = int.Parse(Console.ReadLine());
  10. double normTime = 30000;
  11.  
  12. double playTime = ((365 - freeDays) * 63) + freeDays * 127;
  13.  
  14. double hour = Math.Floor(normTime - playTime)/ 60;
  15. double minutes = Math.Floor(normTime - playTime) % 60;
  16.  
  17.  
  18.  
  19.  
  20. if (normTime <= playTime)
  21. {
  22. Console.WriteLine("Tom will run away");
  23. Console.WriteLine($"{hour} hours and {minutes} minutes more for play");
  24. }
  25. else
  26. {
  27. Console.WriteLine("Tom sleeps well");
  28. Console.WriteLine($"{hour} hours and {minutes} minutes less for play");
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment