Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.16 KB | None | 0 0
  1. //fpc 3.0.0
  2.  
  3. program HelloWorld;
  4.  
  5. var
  6.     // declaration tableau
  7.     table:array[2..20] of string;
  8.     j, i:integer;
  9.     nouvelle_lettre:boolean;
  10.  
  11. begin
  12.  
  13.     // remplissage tableau
  14.     table[2] := 'a';
  15.     table[3] := 'b';
  16.     table[4] := 'c';
  17.     table[5] := 'd';
  18.     table[6] := 'e';
  19.     table[7] := 'f';
  20.     table[8] := 'g';
  21.     table[9] := 'h';
  22.     table[10] := 'i';
  23.     table[11] := 'j';
  24.     table[12] := 'k';
  25.     table[13] := 'l';
  26.     table[13] := 'a';
  27.     table[13] := 'l';
  28.     table[14] := 'e';
  29.     table[15] := 'b';
  30.     table[16] := 'x';
  31.     table[17] := 'd';
  32.     table[18] := 'e';
  33.     table[19] := 'w';
  34.     table[20] := 'z';
  35.    
  36.     // affichage tableau
  37.     for j:= 2 to 20 do
  38.     begin
  39.  
  40.         // verification si lettre a été deja afficher
  41.         nouvelle_lettre := true;
  42.         for i:= 2 to j - 1 do
  43.         begin
  44.             if table[j] =  table[i] then
  45.             begin
  46.                 nouvelle_lettre := false
  47.             end;
  48.         end;
  49.  
  50.         // affichage lettre dans position j
  51.         if nouvelle_lettre then
  52.         begin
  53.             writeln(table[j] );
  54.         end;
  55.        
  56.     end;
  57.    
  58. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement