- 产生数
- 2009-11-02 22:42:24 @
哪位大牛能帮我看一下,小弟感激不尽!
program makethenumber;
var
lall:longint;
sn:string;
g:array[0..9] of longint;
all:array[1..100] of longint;
procedure ready;
var
i,j,k,x,y:longint;
s:string;
f:array[0..9,0..9] of longint;
begin
readln(s);
x:=pos(' ',s);
sn:=copy(s,1,x-1);
val(copy(s,x+1,length(s)-x),k);
fillchar(f,sizeof(f),0);
for i:=1 to k do
begin
readln(x,y);
f[x,y]:=1;
end;
for i:=0 to 9 do f:=1;
for i:=0 to 9 do
for j:=0 to 9 do
for k:=0 to 9 do
f:=f or f and (f[k,j]);
for i:=0 to 9 do
begin
g[i]:=0;
for j:=0 to 9 do inc(g[i],f);
end;
end;
procedure time(x:longint);
var i,t:longint;
begin
t:=0;
for i:=1 to lall+1 do
begin
all[i]:=all[i]*x+t;
t:=all[i] div 10000;
all[i]:=all[i] mod 10000;
end;
if all[i]>0 then inc(lall);
end;
procedure work;
var i,x:longint;
begin
all[1]:=1;
lall:=1;
for i:=1 to length(sn) do
begin
val(sn[i],x);
time(g[x]);
end;
end;
procedure output;
var
i,j:longint;
s:string;
begin
for i:=lall downto 1 do
begin
str(all[i],s);
if i
1 条评论
-
希翼 LV 8 @ 2009-11-03 17:09:09
- 1