| ||||||||||
| 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 | |||||||||
1316为什么这也会错?想不通呀var f:array[1..10000] of boolean;
function next(x:integer):integer;
var temp:integer;
begin
temp:=x;
while x>0 do begin
temp:=temp+x mod 10;
x:=x div 10;
end;
next:=temp;
end;
procedure work;
var i,j:integer;
begin
fillchar(f,sizeof(f),true);
for i:=1 to 9999 do begin
j:=next(i);
if j<10000 then f[j]:=false;
end;
for i:=1 to 9999 do
if f[i] then begin
writeln(i);
readln;
end;
end;
begin
work;
end.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator