Найти ошибки в лабораторной - Turbo Pascal
Формулировка задачи:
Помогите, пожалуйста, найти ошибки в лабе! Я самостоятельно не могу найти, две недели с этой лабораторной мучаюсь.
Решение задачи: «Найти ошибки в лабораторной»
textual
Листинг программы
uses Crt;
procedure Pr1(var ai:integer; var as1, ast:string; as:string);
begin
as1:='';
While as[ai] in [' ','.',',','!','?','0'..'9'] do
begin
ast:=as[ai]+ast;
Dec(ai);
end;
repeat
if ai=0 then Break;
if as[ai] in ['A'..'Z']
then
begin
as1:=as[ai]+as1;
Dec(ai);
if as[ai]=' '
then Break;
end
else
if as[ai] in ['a'..'z']
then
begin
as1:=as[ai]+as1;
Dec(ai);
if as[ai]=' '
then Break;
end
else
if as[ai] in ['0'..'9']
then
begin
as1:=as[ai]+as1;
Dec(ai);
if as[ai]=' '
then Break;
end
else
Dec(ai);
until (as[ai]= ' ') or (ai=0);
end;
var a:Set of Char;
s,s1,st: string;
i,j:integer;
b:boolean;
c:char;
begin
ClrScr;
Writeln('String: ');
Readln(s);
s1:=''; st:=''; a:=[];
i:=Length(s);
Pr1(i,s1,st,s);
st:=s1+st;
for j:=1 to Length(s1) do
a:=a+[Upcase(s1[j])];
repeat
Pr1(i,s1,st,s);
b:=true;
for j:=1 to Length(s1) do
begin
c:=Upcase(s1[j]);
if c in a
then
begin
b:=false;
Break;
end
end;
if b
then
begin
for j:=1 to Length(s1) do
if s1[j] in ['A'..'Z']
then s1[j]:=Char(Ord(s1[j])+32);
st:=s1+st;
end
else
st:=s1+st;
until i=0;
Writeln;
Writeln(st);
ReadKey;
end.