1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| PROGRAM exo;
VAR a,b,c,d,e,f:integer;
cpt1,cpt2,cpt3,cpt4,cpt5,cpt6:integer;
i,n:integer;
TYPE t=array[1..20] of integer;
BEGIN {programme principal}
write('merci d''entrer les vingts chiffres');
for i:=1 to 20 do begin read(n);
t[i]:=n;
end;
a:=t[1];b:=[2];c:=t[3];d:=t[4];e:=t[5];f:=t[6];
while (cpt1<>20) do
if (a<>b) and (a<>c) and (a<>d) and (a<>e) and (a<>f)
then while (cpt2<>20) do
if (b<>a) and (b<>c) and (b<>d) and (b<>e) and (b<>f)
then while (cpt3<>20) do
if (c<>a) and (c<>b) and (c<>d) and (c<>e) and (c<>f)
then while (cpt4<>20) do
if (d<>a) and (d<>b) and (d<>c) and (d<>e) and (d<>f)
then
while (cpt5<>20) do
if (e<>a) and (e<>b) and (e<>c) and (e<>d) and (e<>f)
then
while (cpt6<>20) do
if (f<>a) and (f<>b) and (f<>c) and (f<>d) and (f<>e)
then begin writeln(a,' -',b,'- ',c,'- ',d,'- ',e,'- ',f)
cpt6:=cpt6+1;
f:=t[cpt6];
end
else begin cpt6:=cpt6+1;
f:=t[cpt6];
end
else begin cpt5:=cpt5+1;
e:=t[cpt5];
end
else begin
cpt4:=cpt4+1;
d:=t[cpt4];
end
else begin
cpt3:=cpt3+1;
c:=t[cpt3];
end
else begin
cpt2:=cpt2+1;
b:=t[cpt2];
end
else begin
cpt1:=cpt1+1;
a:=t[cpt1];
end ;
readln;
readln;
END. |
Partager