Advertisement
LOVEGUN

Exercice 1 (Série Yahya #2)

May 16th, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.66 KB | None | 0 0
  1. {https://cdn.discordapp.com/attachments/833273071325675531/835868501952036865/20210425_142227.jpg}
  2. Program exercie1;
  3. Uses Wincrt;
  4. Var
  5. n:integer;
  6. Procedure saisie (Var n:integer);
  7. Begin
  8.   Repeat
  9.     Writeln ('Saisir le nombre de terme');
  10.     Readln (n);
  11.   Until (n>0);
  12. End;
  13.  
  14. Function ajout (ch:String;n:Integer): String;
  15. Var
  16.   ch1: String;
  17.   i: Integer;
  18. Begin
  19.   Str (n,ch1);
  20.   For i:=1 To n Do
  21.     ch := ch+ch1;
  22.   ajout := ch;
  23. End;
  24.  
  25. Procedure suite (n:Integer);
  26. Var
  27.   ch: String;
  28.   i: Integer;
  29. Begin
  30.     ch := '';
  31.   For i:=1 To n Do
  32.     Begin
  33.             ch :=ajout(ch,i);
  34.       Writeln ('U',i,'=',ch);
  35.     End;
  36. End;
  37. Begin
  38.     saisie (n);
  39.     suite (n);
  40. End.
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement