Advertisement
Guest User

Untitled

a guest
Jun 1st, 2016
845
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 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 _02CatTom
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int gameYears = 30000;
  15. int weekendDays = n * 127;
  16. int worksDays = (365 - n) * 63;
  17. int result = weekendDays + worksDays;
  18. int lastResult = Math.Abs(gameYears - result);
  19. int hour = lastResult / 60;
  20. int minutes = lastResult % 60 ;
  21. if (gameYears >= result)
  22. {
  23. Console.WriteLine("Tom sleeps well");
  24. Console.WriteLine("{0} hours and {1} minutes less for play", hour, minutes);
  25. }
  26. else
  27. {
  28. Console.WriteLine("Tom will run away");
  29. Console.WriteLine("{0} hours and {1} minutes more for play", hour, minutes);
  30. }
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement