- 不高兴的津津
- 2013-12-01 17:20:44 @
#include<stdio.h>
int main()
{
int a[7][2],b[7];
int i,k=0,max=0,n;
for(i=0;i<7;i++)
scanf("%d%d\n",a[i][1],a[i][2]);
b[i]=a[i][1]+a[i][2];
if(b[i]>8)
{
k++;
if(b[i]>max)
{
max=b[i];
n=i;
}
}
if(k==0) printf("0");
else
{
printf("%d",n);
}
return 0;
}
5 条评论
-
Jessy LV 8 @ 2016-09-18 19:14:40
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int ans=0,a=0,x,y;
for(int i=1;i<=7;i++)
{
scanf("%d%d",&x,&y);
if(x+y>8&&x+y>ans)
{
a=i;ans=x+y;
}
}
cout<<a;
} -
2016-08-31 12:45:18@
读入的那个for有毒吧
应该是 for(i=1;i<=7;i ++)吧
你写的是i<7
这样是不是只读入了6个? -
2016-02-23 13:55:05@
代码:#include<stdio.h>
int main()
{
int max=0,s=0,time1,time2,i,t;
for(i=1;i<=7;i++)
{
scanf("%d %d\n",&time1,&time2);
s=time1+time2;
if(s>8 && s>max)
{
max=s;
t=i;
}
}
printf("%d",t);
return 0;
} -
2013-12-01 19:33:11@
int main()
{
int a[7][2],b[7];
int i,k=0,max=0,n;
for(i=0;i<7;i++)
{//Here you need one
scanf("%d%d\n",a[i][1],a[i][2]);
b[i]=a[i][1]+a[i][2];
if(b[i]>8)
{
k++;
if(b[i]>max) max=b[i], n=i;
}
}//Here you need another one
}
Understand? -
2013-12-01 17:21:03@
为什么= =
打错了……
- 1