帮忙看看#12怎么过
查看原帖
帮忙看看#12怎么过
1361712
peana楼主2024/6/3 11:52
#include<iostream>
using namespace std;
int main()
{
int i,j,st,ast,a[7],n,temp,key;
for(i=0;i<7;i++)
{
    cin>>st>>ast;
    n=st+ast;
    a[i]=n;
}
temp=0;
for(j=0;j<7;j++)
{
    if(a[j]>temp)
    {
        temp=a[j];
        key=j;
    }
}
if(a[key]>=8)cout<<key+1;
if(a[key]<8)cout<<"0";
return 0;
}

100分但是#12没过

2024/6/3 11:52
加载中...