fork(13) download
  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.
Success #stdin #stdout 0s 232KB
stdin
bac
2
2
stdout
ch1 = Position = Nbre caractères = La chaîne copiée est : ac