Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- const int WORKING_DAY_MINUTES_TO_PLAY = 63;
- const int HOLIDAY_MINUTES_TO_PLAY = 127;
- const int ANNUAL_RATE_OF_PLAY_IN_MINUTES = 30000;
- int holidaysCount;
- cin >> holidaysCount;
- int workingDayMinutes = (365 - holidaysCount) * WORKING_DAY_MINUTES_TO_PLAY;
- int holidayMinutes = holidaysCount * HOLIDAY_MINUTES_TO_PLAY;
- int sumMinutes = workingDayMinutes + holidayMinutes;
- int result = abs(sumMinutes - ANNUAL_RATE_OF_PLAY_IN_MINUTES);
- cout << (sumMinutes >= 30000 ? "Tom will run away" : "Tom sleeps well") << endl;
- cout << result / 60 << " hours and " << result % 60 << " minutes " << (sumMinutes >= 30000 ? "more" : "less") << " for play" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement