'commit'
This commit is contained in:
16
TangDou/CSP-J/AcWingTraining/T1/417.cpp
Normal file
16
TangDou/CSP-J/AcWingTraining/T1/417.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
int a, b;
|
||||
int day, mx; // 哪一天最不开心,最大值是多少,两个变量记录
|
||||
int main() {
|
||||
for (int i = 1; i <= 7; i++) { // 分别表示周一到周日的日程安排
|
||||
cin >> a >> b; // 津津在学校上课的时间和妈妈安排她上课的时间
|
||||
if (a + b > 8 && a + b > mx) { // 津津如果一天上课超过八个小时就会不高兴
|
||||
mx = a + b; // 更新最大值
|
||||
day = i; // 记录哪一天
|
||||
}
|
||||
}
|
||||
cout << day << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user