332 条题解
-
0weizhanjun LV 5 @ 2013-11-07 22:36:56
var
a, b, i, s: integer;
sum: array[1..7] of integer;
begin
for i := 1 to 7 do
begin
Read(a, b);
sum[i] := a + b;
if sum[i] > 8 then
begin
s := i;
break;
end;
end;
Write(i);
end. -
02013-11-06 19:29:10@
var
x,y,i,max,top:longint;
begin
max:=7; top:=0;
for i:=1 to 7 do
begin
readln(x,y);
if x+y>max then begin max:=x+y; top:=i; end;
end;
writeln(top);
end. -
02013-10-31 22:11:37@
#include <iostream>
using namespace std;int main()
{
int i,tmp1,tmp2,maxuh=0,maxi1=0;
for (i=0;i<7;++i)
{
cin>>tmp1>>tmp2;
if (tmp1+tmp2>maxuh)
{
maxuh=tmp1+tmp2;
maxi1=i+1;
}
}
cout<<maxi1<<endl;
return 0;
} -
02013-10-29 20:18:00@
var a:array[1..7]of longint;
i,j,k,max,ans:longint;
begin
max:=0;
for i:=1 to 7 do
begin
readln(j,k);
if j+k>max then begin max:=j+k; ans:=i; end;
end;
write(ans);
end. -
02013-10-28 19:16:40@
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
using namespace std;
int school,mum;
int main()
{int i=1;
int j=0;
while(scanf("%d %d",&school,&mum)!=EOF)
{
if(school+mum>8)
{printf("%d",i);
j=1;
return 0;
}
i++;
}
if(j!=1)
printf("%d",0);
return 0;
}学的判断EOF的语句第一次用哎~
-
02013-10-24 22:01:06@
program happy;
var i,ans,d:longint;
a:array[1..7,1..2] of longint;
begin
for i:=1 to 7 do
begin
read(a[i,1],a[i,2]);
if (a[i,1]+a[i,2]>ans) and (a[i,1]+a[i,2]>8) then
begin
ans:=a[i,1]+a[i,2];
d:=i;
end;
end;
writeln(d);
end. -
02013-10-22 22:02:57@
#include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
int main()
{
int x,y,k,max=-1;
for(int i=1;i<=7;i++)
{
cin>>x>>y;
if(x+y>max)
{
max=x+y;
k=i;
}
}
cout<<k;
return 0;
} -
02013-09-25 21:22:25@
int main(int argc, char* argv[])
{
int a[7];
int most1=0,most2,sum,i,school,home;
for (i=0;i<7;i++)
{
scanf("%d%d",&school,&home);
sum=school+home;
a[i]=sum;
if(sum>most1)
{
most1=sum;
most2=i;
}
}
printf("%d\n",most2+1);
return 0;
}
谁的代码有我短, 我这还有格式呢 刨除去格式 太短了实在 -
02013-08-15 14:20:05@
var i,a,b,max,lc:integer;
begin
max:=8;
for i:= 1 to 7 do begin
readln(a,b);
if a+b>max then begin
max:=a+b;
lc:=i;
end;
end;
writeln(lc);
end. -
02013-07-25 20:35:42@
用最古老原始的方法ac。。。
#include<iostream>
int a[21];
int main()
{
using namespace std;
short i,n=0,max=0;
for(i=1;i<=14;i++)
cin>>a[i];
a[15]=a[1]+a[2];
a[16]=a[3]+a[4];
a[17]=a[5]+a[6];
a[18]=a[7]+a[8];
a[19]=a[9]+a[10];
a[20]=a[11]+a[12];
a[21]=a[13]+a[14];
for(i=15;i<=21;i++)
if(a[i]>max)
{
max=a[i];
n=i;
}
cout<<n-14;
return 0;
} -
02013-07-21 17:57:04@
wow!
-
02013-07-09 21:51:21@
缩小数据范围反而时间更长。。
-
02012-11-28 10:44:45@
var
i,t,k:integer;
x,a,b:array[1..8] of integer;
begin
for i:=1 to 7 do
begin
readln(a[i],b[i]);
x[i]:=a[i]+b[i];
end;
t:=0;
for i:=1 to 7 do
begin
if x[i] >t then
begin
t:=x[i];
k:=i;
end;
end;
if t > 8 then writeln(k)
else writeln('0');
readln;
readln
end. -
02012-11-25 16:56:06@
var
a,b:array[0..14] of integer;
c:array[0..14]of integer;
d,e,i:integer;
begin
for i:=1 to 7 do
begin
read(a[i],b[i]);
c[i]:=a[i]+b[i];
end;
for i:= 1 to 7 do
begin
if c[i] >8 then inc(d);
if (c[i]>=c) and (c[i]>c[e]) then e:=i;
end;
if d>0 then write(e)
else write(0)
end. -
02012-11-18 10:44:59@
#include
int main()
{
int i,a[10],b[10],max=0,he=9;
for(i=1;i=1;i--)
{
if(a[i]+b[i]>=he)he=a[i]+b[i],max=i;
}
printf("%d",max);
return 0;
} -
02012-11-11 13:28:22@
今日光棍节,见一水题,刷之以庆!
点这里查看程序源码+详细题解
-
02012-11-01 18:44:56@
// 不高兴的津津
#include
using namespace std;
int main ( )
{
int shangke[7][2];
int bugaoxing[8];
bugaoxing[7] = 8;
int xingqiji;
int panduan = 0;
for ( int i = 0; i < 7; i++ )
{
for ( int j = 0; j < 2; j++ )
{
cin >> shangke[i][j];
}
}
for ( int i = 0; i < 7; i ++ )
{
for ( int j = 0; j < 1; j++ )
{
bugaoxing[i] = shangke[i][j] + shangke[i][j + 1];
}
if ( bugaoxing[i] > bugaoxing[7] )
{
bugaoxing[7] = bugaoxing[i];
xingqiji = ( i + 1 );
panduan += 1;
}
}
if ( panduan == 0 )
{
cout -
02012-10-24 20:57:38@
var
a:array[1..7]of integer;
b,c,d,s,i:integer;
begin
for i:=1 to 7 do
begin
readln(c,d);
a[i]:=c+d;
end;
s:=2;
b:=1;
for i:=1 to 6 do
begin
if a>=a then
b:=b else b:=s;
s:=s+1;
end;if a
-
02012-08-02 14:56:27@
点击查看代码
-
02012-07-27 10:16:59@
var i,t1,t2,max,x:integer;
nn:array[1..7] of integer;
begin
for i:=1 to 7 do
begin
readln(t1,t2);
nn[i]:=t1+t2;
end;
for i:=1 to 7 do if nn[i]>max then begin max:=nn[i];x:=i;end;
if max