1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| #include<bits/stdc++.h> using namespace std; int main(){ int day,night,zong[7],max,ans,d; max=0; ans=0; for(d=1;d<=7;d++) { cin>>day>>night; zong[d]=day+night; } for(d=7;d>=1;d--) { if(zong[d]>max&&zong[d]>8) { zong[d]=max; ans=d; } } cout<<ans<<endl; return 0; }
|