1 solutions

  • 0
    @ 2025-11-5 20:07:55

    C++ :

    #include<iostream>
    #include<cstdio>
    using namespace std;
    int main()
    {
    	//freopen("unhappy.in","r",stdin);
    	//freopen("unhappy.out","w",stdout);
    	int flag=-1,my_max=-1,a,b;
    	for(int i=1;i<=7;++i)
    	{
    		cin>>a>>b;
    		if(a+b>my_max)
    		{
    			my_max=a+b;
    			flag=i;
    		}
    	}
    	if(my_max>8)cout<<flag<<endl;
    	else cout<<0<<endl;
    	return 0;
    }
    
    • 1

    Information

    ID
    20040
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By