-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17-task8(CP).cpp
More file actions
34 lines (31 loc) · 813 Bytes
/
17-task8(CP).cpp
File metadata and controls
34 lines (31 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
using namespace std;
void pet(int holidays);
main()
{
int holidays;
cout << "Holidays: ";
cin >> holidays;
pet(holidays);
}
void pet(int holidays)
{
int workingDays, timeForGame, norm, difference, hours, minutes;
workingDays = 365-holidays;
timeForGame = ((workingDays * 63) + (holidays * 127));
norm = 30000;
if(norm > timeForGame){
difference = norm - timeForGame;
cout << "Tom sleeps well" <<endl;
hours = difference / 60;
minutes = difference % 60;
cout << hours <<" hours and " << minutes <<" minutes less for play";
}
if(norm < timeForGame){
difference = timeForGame - norm;
cout << "Tom will run away" <<endl;
hours = difference / 60;
minutes = difference % 60;
cout << hours <<" hours and " << minutes <<" minutes for play";
}
}