d702.
SOS
| From: [183.4.125.183] |
發表日期
:
2012-08-14 17:53
第 3 測資點(20%): OLE (line:101)
冗余输出
請勿輸出題目未要求的文字:
120117110105763245325456511053211411110232934850475048474849485091325045484652465032678070000000000000000000000408611316800036861131640003286113160000288611315600024861131520002086113148000168611314400012861131400008861131360004861131320000
1、2測資點AC了
3至5測資點都是這個錯誤(那個行數也很特別分別是:line:101、line:501、line:1001!)
源代碼:
const size=150;
type
num=array[1..size]of byte;
var
s:array[1..1000]of num;
i,n,t:integer;
function sum(a,b:num):num;
var i,t,st:integer;
begin
t:=0;
for i:=1 to size do
begin
st:=a[i]+b[i]+t;
sum[i]:=st mod 10;
t:=st div 10;
end;
end;
begin
fillchar(s,sizeof(s),0);
s[1,1]:=1;
s[2,1]:=1;
s[3,1]:=1;
for i:=4 to 1000 do
s[i]:=sum(s[i-2],s[i-3]);
while not eof do
begin
readln(n);
t:=size;
while s[n,t]=0 do dec(t);
for i:=t downto 1 do write(s[n,i]);
writeln;
end;
end.
怎麼調試都找不出錯誤,誰能告訴我這是怎麼回事?