1 réponse
pour les exercices tu cliques ici
Pour le problème,voici le programme:
Program test;
Uses wincrt ;
Var i,j,dim,:integer;
A,t:array[1..100] of integer;
Label lab1,lab2;
Begin
Write('Donnez le nombre de cellules dans votre tableau');
read(dim);
For i:=1 to dim do
Begin
read A[i];
For j:=1 to dim do
Begin
If A[i]=A[j] then t[i]:=t[i]+1
Else goto lab1;
Lab1:
End;
If t[i]<>2 then write(A[i],’n’’existe pas 2 fois’)
Else goto lab2;
Lab2:
End;
End.
Pour le problème,voici le programme:
Program test;
Uses wincrt ;
Var i,j,dim,:integer;
A,t:array[1..100] of integer;
Label lab1,lab2;
Begin
Write('Donnez le nombre de cellules dans votre tableau');
read(dim);
For i:=1 to dim do
Begin
read A[i];
For j:=1 to dim do
Begin
If A[i]=A[j] then t[i]:=t[i]+1
Else goto lab1;
Lab1:
End;
If t[i]<>2 then write(A[i],’n’’existe pas 2 fois’)
Else goto lab2;
Lab2:
End;
End.