Program S8;
Type
Tab = Array[1..9] Of String;
Var
T,TM : tab;
N : integer ;
//***********************************
Procedure Saisie_N(Var N:integer);
Begin
Repeat
Write('Donner le nombre d''utilisateurs : ');
Readln(n);
Until n In [1..9];
End;
//***********************************
Procedure Remplissage(Var T:tab; N:integer);
Var
i,j : integer;
Begin
For i:=1 To n Do
Repeat
Write('Donner le nom de l''utilisateur n° ',i,' : ');
Readln(T[i]);
j := 0;
Repeat
j := j+1;
Until Not(T[i][j] In ['A'..'Z']) Or (j=Length(T[i]));
Until (T[i][j] In ['A'..'Z']) And (Length(T[i]) <=20);
End;
//***********************************
Procedure FormerTM(Var TM:tab; T:tab; N:integer);
Var
i,j,nb_occurence : integer;
ch_nb : String;
Begin
For i:=1 To n Do
Begin
nb_occurence := 0;
For j:=1 To length(T[i]) Do
Case (T[i][j]) Of
'E','I','U','Y' : nb_occurence := nb_occurence+1;
'A' :
Begin
nb_occurence := nb_occurence+1;
T[i][j] := '@'
End;
'O' :
Begin
nb_occurence := nb_occurence+1;
T[i][j] := '0'
End;
End;
str(nb_occurence,ch_nb);
TM[i] := T[i] + ch_nb;
End;
End;
//***********************************
Procedure Afficher(T:tab; N:integer);
Var
i : integer;
Begin
Writeln('La liste des identificateurs générés est : ');
For i:=1 To n Do
Write(' | ',T[i]:5);
End;
//***********************************
Begin
Saisie_N(N);
Remplissage(T,N);
FormerTM(TM, T, N);
Afficher(TM, N);
End.
Inscription à :
Publier les commentaires (Atom)