| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
报告:judge把我程序的数组越界判成wa了~(郁闷了我半天……)Source:
program p2000;
var v:array[0..10000]of longint;
n:longint;
procedure init;
var i,j,k:longint;
begin
fillchar(v,sizeof(v),0);
k:=1;i:=1;v[0]:=0;
while i<=10000 do begin
for j:=1 to k do begin
v[i]:=v[i-1]+k; //这里的v[i]越界
inc(i);
end;
inc(k);
end;
end;
begin
// assign(input,'input.txt');reset(input);
// assign(output,'output.txt');rewrite(output);
init;
readln(n);
while n<>0 do begin
writeln(n,' ',v[n]);
readln(n);
end;
// close(input);close(output);
end.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator