Advertisement
Guest User

Sleeping cat tom

a guest
Oct 8th, 2016
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 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 Sleeping_cat_tom
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int dayOff = int.Parse(Console.ReadLine());
  14. int normTom = 30000;
  15. int wdPlay = 63;
  16. int dfPlay = 127;
  17. int workday = 365 - dayOff;
  18. int realPlay = (workday * wdPlay + dayOff * 127);
  19. int diffPlay = (normTom - realPlay);
  20. int hours = diffPlay / 60;
  21. double min = hours / 60;
  22.  
  23. if (realPlay > 30000)
  24. {
  25. Console.WriteLine("Tom will run away");
  26. Console.WriteLine("{0} hours and {1} minutes more for play",hours,min);
  27. }
  28. else
  29. {
  30. Console.WriteLine("Tom sleeps well");
  31. Console.WriteLine("{0} hours and {1} minutes less for play",hours,min);
  32. }
  33.  
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement