思路
- t≤360 时,休息 0 分钟。
- 360<t≤390 时,休息 t−360 分钟。
- 390<t≤570 时,休息 30 分钟。
- 570<t≤585 时,休息 t−540 分钟。
- 585<t≤645 时,休息 45 分钟。
- t>645 时,休息 t−600 分钟。
CODE
C++#include<iostream>
using namespace std;
int main() {
int t;
cin >> t;
if(t <= 360) {
cout << 0 << endl;
}
else if(t <= 390){
cout << t - 360 << endl;
}
else if(t <= 570) {
cout << 30 << endl;
}
else if(t <= 585){
cout << t - 540 << endl;
}
else if(t <= 645){
cout << 45 << endl;
}
else cout << t - 600 << endl;
return 0;
}