代码如下:
#include <iostream>
using namespace std;
int main(){
int unhappy = 0,max_time = 0,school_time = 0,other_time = 0;
for(int i = 0;i < 7;i++){
cin>>school_time>>other_time;
if(school_time + other_time >= 8 && school_time + other_time > max_time){
unhappy = i + 1;
max_time = school_time + other_time;
}
}
cout<<unhappy;
return 0;
}