这道题就是经典的条件分支的题 https://www.luogu.org/problemnew/show/P1085
code:
#include <stdio.h> int main() { int x,y,c[8],i,s=0,k; for(i=1;i<=7;i++) { scanf("%d %d",&x,&y); c[i]=x+y; if(c[i]>s) { s=c[i]; k=i; } } if(s==0)printf("0"); else printf("%d",k); return 0; }