• Aucun résultat trouvé

var t:tab

N/A
N/A
Protected

Academic year: 2022

Partager "var t:tab"

Copied!
2
0
0

Texte intégral

(1)

program EX03;

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 n:integer);

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,' de lettres Maj de longueur entre 2..12 ');

readln(t[i]);

until (length(t[i]) in [2..12]) and (verif(t[i]));

end;

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

(2)

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.

Références

Documents relatifs

In Datasheet view, you can edit fields, add and delete data, and search for data.. In Access 2007, you

Si vous êtes enceinte ou que vous allaitez, si vous pensez être enceinte ou planifiez une grossesse, demandez conseil à votre médecin ou pharmacien avant de prendre ce médicament..

[r]

[r]

writeln('Le tableau suite à la segmentation sera

[r]

تمايلعتلا هذه تيعور اذإ لاإ بيكترلا اذه ةملاس نماض نكيم لا .هذه ةملاسلا تمايلعت ظفح ىجري .لماعتسلااو بيكترلا ءانثأ :تاظحلام ةقاطلا ردصم نأ نم دكأت ،هيف فصرتلا دنعو

TABLEAU DE CORRESPONDANCE CARACTERES LATINS - GRECS DANS LA POLICE GREEK.TTF. Les nombres représentent les