津津的学习压力:判断她哪天最不高兴
#include <iostream>
using namespace std;
int main() {
int schedule[7][2];
int max_unhappy = 0;
int max_day = 0;
// 输入每天的日程安排
for (int i = 0; i < 7; i++) {
cin >> schedule[i][0] >> schedule[i][1];
}
// 检查每天是否会不高兴
for (int i = 0; i < 7; i++) {
int total_hours = schedule[i][0] + schedule[i][1];
if (total_hours > 8 && total_hours - 8 > max_unhappy) {
max_unhappy = total_hours - 8;
max_day = i + 1;
}
}
// 输出结果
cout << max_day << endl;
return 0;
}
原文地址: https://www.cveoy.top/t/topic/o7St 著作权归作者所有。请勿转载和采集!