- 奖学金
- 2009-07-16 13:57:23 @
关于这道题的第五和第七组数据,总是过不了,是什么地方没考虑?
程序:
program v1398;
var
a,b,c,n,i,j,k,t:longword;
f,yw,xh:array[1..6] of longword;
begin
readln(n);
for i:=1 to n do
begin
readln(a,b,c);
k:=a+b+c;j:=1;
while (kyw[j]) then
begin
for t:=5 downto j+1 do
begin xh[t]:=xh[t-1];yw[t]:=yw[t-1];f[t]:=f[t-1] end;
xh[j]:=i;yw[j]:=a;f[j]:=k
end
else
begin
for t:=5 downto j+2 do
begin xh[t]:=xh[t-1];yw[t]:=yw[t-1];f[t]:=f[t-1] end;
xh[j+1]:=i;yw[j+1]:=a;f[j+1]:=k
end;
end;
end;
for i:=1 to 5 do
writeln(xh[i],' ',f[i]);
end.
2 条评论
-
skay LV 7 @ 2014-08-12 15:00:24
请问是哪错了?
-
2009-07-16 15:20:46@
终于知道了~~~原来是个很有趣的地方错了
- 1