fork download
  1. program lista_uproszczona_usun_elem_z_p;
  2. type tab=array[1..10]of integer;
  3. lst = record
  4. elementy: tab;
  5. ile: integer
  6. end;
  7. var
  8. i, p: integer;
  9. x: lst;
  10.  
  11. begin
  12. read(x.ile);
  13. for i := 1 to x.ile do
  14. read(x.elementy[i]);
  15.  
  16. read(p);
  17.  
  18. if (p >= 1) and (p <= x.ile) then
  19. begin
  20. for i := p to x.ile-1 do
  21. x.elementy[i] := x.elementy[i+1];
  22. x.ile := x.ile - 1;
  23. end;
  24.  
  25. for i := 1 to x.ile do
  26. write(x.elementy[i], ' ');
  27. end.
Success #stdin #stdout 0s 5288KB
stdin
5 10 20 30 40 50 3
stdout
10 20 40 50