Advertisement
Jann24

zad3

Nov 20th, 2024
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. int daysOffWork = int.Parse(Console.ReadLine());
  2. int workDays = 365 - daysOffWork;
  3.  
  4. int playtime = (daysOffWork * 127) + (workDays * 63);
  5.  
  6. int remainingPlaytimeHours = Math.Abs(30000-playtime) / 60;
  7. int RemainingPlaytimeMinutes = Math.Abs(30000-playtime) % 60;
  8.  
  9. if (playtime < 30000)
  10. {  
  11.     Console.WriteLine("Tom sleeps well");
  12.     Console.WriteLine($"{remainingPlaytimeHours} hours and {RemainingPlaytimeMinutes} minutes less for play");
  13. }
  14. else
  15. {
  16.     Console.WriteLine("Tom will run away");
  17.     Console.WriteLine($"{remainingPlaytimeHours} hours and {RemainingPlaytimeMinutes} minutes more for play");
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement