• 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 Ex_11_s4;

uses wincrt;

type

tab=array[1..25] of integer;

var t:tab;

i,n:integer;

procedure saisie(var t:tab; var n:integer);

begin repeat

writeln('Donner n entre 5 et 25 :');

readln(n);

until n in [5..25];

for i:=1 to n do repeat

writeln('Donner un entier d''au moins trois chiffres T ',i);

readln(t[i]);

until t[i]>=100;

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 nombres ZigZag Sont:');

For i:=1 to n do begin

str(t[i],ch);

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));

(2)

if (test) then writeln(t[i]);

end; end;

begin

saisie(t,n);

affiche(t,n);

zigzag(t,n);

end.

Références

Documents relatifs

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

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