Advertisement
Arfizato

Untitled

Mar 16th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.50 KB | None | 0 0
  1. Program R0kS;
  2. uses wincrt;
  3. type tab=array[1..15] of integer;
  4. var t:tab;
  5. i,n,e,z:integer;
  6. Begin
  7. repeat
  8. writeln('n=');
  9. readln(n);
  10. until (n>=1) and (n<=15);
  11. for i:=1 to n do
  12. begin
  13. writeln('saisir la case',' ',i);
  14. readln(t[i]);
  15. end;
  16. for i := 1 to n do
  17.  write(t[i],'/');
  18.  writeln;
  19. e:=n+1;
  20. for i:=1 to n do
  21. begin
  22. e:=e-1;
  23. z :=  t[i] ;
  24.                                 write(z,'  ');
  25. t[i]:= t[e];
  26.                                 write(t[i],'  ');
  27.                                
  28. t[e] := z ;
  29.                                 writeln;
  30. end;
  31. for i := 1 to n do
  32.  write(t[i],'/');
  33.  
  34. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement