Run Code
|
API
|
Code Wall
|
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
record as a procedure argument
66
zad27-optimized
1
DOKIMH-2
Sum of array
непарное число в массиве
s
Typecast an array to other type
zadacha1