不行!大牛们,帮我看看吧!

program L1;

var

i,j,k,l,m,n,code:longint;

st:string;

procedure make(st:string);

var

i,j,k,l,m,n:longint;

a:array[1..10000] of longint;

ch:char;

x,y,z:longint;

function check(s,m:longint):boolean;

var

i,j:longint;

begin

check:=false;

for i:=1 to m-1 do

if s=a[i] then

begin

check:=true;

for j:=i to m-1 do write(a[j],' ');

writeln;

end;

end;

begin

fillchar(a,sizeof(a),0);

z:=1000;m:=0;l:=length(st);

while not check(z,m) do

begin

n:=length(st);

for i:=1 to n-1 do

for j:=i+1 to n do

if st[i]st[j] then

begin

ch:=st[i];st[i]:=st[j];st[j]:=ch;

end;

val(st,y,code);

z:=abs(x-y);

str(z,st);

inc(m);

a[m]:=z;

end;

end;

begin

while not(eof) do

begin

readln(st);

make(st);

end;

end.

0 条评论

目前还没有评论...

信息

ID
1024
难度
6
分类
模拟 点击显示
标签
(无)
递交数
6780
已通过
1566
通过率
23%
被复制
13
上传者