Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
XEPBAN
//fpc 3.0.0 program XEPBAN; const fi='XEPBAN.INP'; fo='XEPBAN.OUT'; max=200; var x: array[1..max] of string; n,i: byte; procedure xuly; var Begin for i:=1 to n do X[i]:=i; Repeat for i:=1 to n do write(x[i],' '); writeln; i:=n-1; while (i>0) and (x[i]>x[i+1]) do Dec(i); if i>0 then begin k:=n; while x[k]<x[i] do Dec(k); swap(x[k],x[i]); a:= i+1; b:=n; while a<b do begin swap(x[a],x[b]); inc(a); dec(b); end; end; Until i=0; End; BEGIN assign(input,fi); reset(input); assign(output,fo); rewrite(output); readln(n); for i:=1 to n do readln(x[i]); xuly; close(input); close(ouput); END.
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
12 13
вывод строк символов
shift array to left
03 ariketa
For1
Banyaknya huruf vokal
La calculatrice
practica 5 ejercicio 1
Thao Vi
BubbleSor (slimmer)
Please log in to post a comment.