大佬请挑错
#include<bits/stdc++.h> using namespace std; int main(){ int t1,t2,st=7,nohappy=0; for(int i=1;i<8;i++){ cin>>t1>>t2; if(t1+t2>st){ st=t1+t2; nohappy=i; } } cout<<nohappy; return 0; }
这里只要>st(>了便是>8)就行了