由于题目不难,所以随便写吧。
#include <cstring>
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iomanip>
using namespace std;
int main() {
int hours[7][2];
int max_hours = 0;
int max_day = 0;
for(int i = 0; i < 7; i++) {
cin >> hours[i][0] >> hours[i][1];
int tot = hours[i][0] + hours[i][1];
if(tot > 8) {
if(tot > max_hours) {
max_hours = tot;
max_day = i + 1;
}
}
}
cout << max_day << endl;
}