主题:帮我看看这个程序哪里有问题啊,怎么编译都通不过
我找了半天,都不知道哪里出问题了。。帮个忙谢谢。
procedure ex8_6;
var sou,tar,tas,ts,tt:string;
ch:char;
procedure passin(tp:string);
var i,d:byte;
begin
for i:=1 to length(tp) do
begin
d:=ord(tp[i]);
d:=(d-32+length(tp)+i)mod 223+32;
tar:=tar+chr(d);
end;{for}
end;{passin}
procedure passout(tp:string);
var i,d:integer;
begin
for i:=1 to length(tp) do
begin
d:=ord(tp[i]);
d:=(d+32) mod 223-32-length(tp)-i;
tas:=tas+chr(d);
end;{for}
end;{passout}
procedure encrypt;
begin
write('Please Input the Source String:');
readln(sou);tar:=' ';
ts:=sou+' ';
while (pos(' ',ts))<>0 do
begin
tt:=copy(ts,1,pos(' ',ts)-1);
delete(ts,1,pos(' ',ts));
if tt<>' ' then passin(tt);
tar:=tar+' ';
end;{while}
delete(tar,length(tar),1);
write('The Password String is:');writeln(tar);
end;{encrypt}
procedure menu;
begin
writeln(' --------------------');
writeln(' | 1. Encrypt |');
writeln(' | 2. Decrypt |');
writeln(' | 3. Quit |');
writeln(' --------------------');
writeln;writeln;
write('Choice:');
end;{menu}
procedure decrypt;
begin
write('Please Input Password String:');
readln(tar);tas:=' ';
ts:=tar+' ';
while (pos(' ',ts)<>0) do
begin
tt:=copy(ts,1,pos(' ',ts)-1);
delete(ts,1,pos(' ',ts));
if tt<>' ' then passout(tt);
tas:=tas+' ';
end;{while}
delete(tas,length(tas),1);
write('The Source String is:');writeln(tas);
end;{decrypt}
begin
repeat
menu;
readln(ch);
if not(ch in['1'..'3']) then writeln('Input Error!');
writeln;
write('Press enter ...');readln;
until ch='3';
end.{main}
procedure ex8_6;
var sou,tar,tas,ts,tt:string;
ch:char;
procedure passin(tp:string);
var i,d:byte;
begin
for i:=1 to length(tp) do
begin
d:=ord(tp[i]);
d:=(d-32+length(tp)+i)mod 223+32;
tar:=tar+chr(d);
end;{for}
end;{passin}
procedure passout(tp:string);
var i,d:integer;
begin
for i:=1 to length(tp) do
begin
d:=ord(tp[i]);
d:=(d+32) mod 223-32-length(tp)-i;
tas:=tas+chr(d);
end;{for}
end;{passout}
procedure encrypt;
begin
write('Please Input the Source String:');
readln(sou);tar:=' ';
ts:=sou+' ';
while (pos(' ',ts))<>0 do
begin
tt:=copy(ts,1,pos(' ',ts)-1);
delete(ts,1,pos(' ',ts));
if tt<>' ' then passin(tt);
tar:=tar+' ';
end;{while}
delete(tar,length(tar),1);
write('The Password String is:');writeln(tar);
end;{encrypt}
procedure menu;
begin
writeln(' --------------------');
writeln(' | 1. Encrypt |');
writeln(' | 2. Decrypt |');
writeln(' | 3. Quit |');
writeln(' --------------------');
writeln;writeln;
write('Choice:');
end;{menu}
procedure decrypt;
begin
write('Please Input Password String:');
readln(tar);tas:=' ';
ts:=tar+' ';
while (pos(' ',ts)<>0) do
begin
tt:=copy(ts,1,pos(' ',ts)-1);
delete(ts,1,pos(' ',ts));
if tt<>' ' then passout(tt);
tas:=tas+' ';
end;{while}
delete(tas,length(tas),1);
write('The Source String is:');writeln(tas);
end;{decrypt}
begin
repeat
menu;
readln(ch);
if not(ch in['1'..'3']) then writeln('Input Error!');
writeln;
write('Press enter ...');readln;
until ch='3';
end.{main}