EmoRz

Tom

Jun 28th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 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 Tom
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var freeDays = double.Parse(Console.ReadLine());
  14. var norma = 30000;
  15. var dayWork = 63;
  16. var dayVacanc = 127;
  17. var year = 365-freeDays;
  18.  
  19. var result1 = (year * dayWork) + (dayVacanc * freeDays);
  20.  
  21. var result2 = norma-result1;
  22.  
  23. var h = Math.Truncate(Math.Abs(result2 / 60));
  24. var min =Math.Truncate(Math.Abs(result2 % 60));
  25.  
  26. if (norma > result1)
  27. {
  28. Console.WriteLine("Tom sleeps well");
  29. Console.WriteLine("{0} hours and {1} minutes less for play", h, min);
  30. }
  31.  
  32. if (norma < result1)
  33. {
  34. Console.WriteLine("Tom will run away");
  35. Console.WriteLine("{0} hours and {1} minutes more for play", h, min);
  36. }
  37.  
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment