False: String
False: String
uses wincrt;
type
tab=array[1..10] of string[13];
var
t:tab;
i,n:integer;
function verif(ch:string):boolean;
var
test:boolean;
j:integer;
begin
j:=0;
repeat
inc(j);
test:= ch[j] in ['A'..'Z'];
until (j=length(ch)) or (test=false);
end;
procedure saisie(var t:tab; var
begin
repeat
writeln('Donner n entre 5 et 10
readln(n);
until n in [5..10];
for i:=1 to n do
repeat
writeln('Donner la chaine ',i,'
readln(t[i]);
until (length(t[i]) in [2..12])
end;
n:integer);
:');
procedure Affiche(t:tab;n:integer);
begin
for i:=1 to n do
write(t[i],' | ');
end;
procedure zigzag(t:tab;n:integer);
var
ch:string;
test,testc,testd:boolean;
j:integer;
begin
WRITELN;
writeln('Les mots ZigZag Sont:');
For i:=1 to n do
begin
ch:=t[i];
j:=2;
if ord(ch[j])>ord(ch[j-1]) then
begin
testc:=true;
testd:=false;
end;
if ord(ch[j])<ord(ch[j-1]) then
begin
testc:=false;
testd:=true;
end;
repeat
inc(j);
test:=false;
if (testc) and (ord(CH[j])<ord(ch[j-1])) then
begin
test:=true;
testc:=false;
testd:=true;
end;
if (testd) and (ord(CH[j])>ord(ch[j-1])) then
begin
test:=true;
testc:=true;
testd:=false;
end;
until (test=false) or (j=length(ch));
if (test) then
writeln(t[i]);
end; end;
begin
saisie(t,n);
affiche(t,n);
zigzag(t,n);
end.