lundi 12 septembre 2016
    1. Program Copie_ch;
    2. Var
    3. ch1, chr : String;
    4. i, p, n, l : Integer;
    5. Begin
    6. Write ('ch1 = ');
    7. Readln (ch1);
    8. l:=Length (ch1);
    9. Repeat
    10. Write ('Position = ');
    11. Readln (p);
    12. Write ('Nbre caractères = ');
    13. Readln (n);
    14. Until (p in [1..l]) and (n in [1..l]) and (p+n<=l+1);
    15. chr:='';
    16. For i:=p To p+n-1 Do chr:=chr+ch1 [i];
    17. Writeln ('La chaîne copiée est : ', chr);
    18. End.

0 commentaires:

Enregistrer un commentaire

Page Facebook

Turbo Pascal 32 bits

Turbo Pascal 64 bits