Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sorting_direct_choise_no_optimized
const n = 15; var a: array [1..n] of integer;// = (57, 75, 21, 59, 14, 38, 29, 65, 61, 35, 95, 36, 30, 59, 13, 62, 42, 88, 8, 72, 19, 32, 91, 60, 68, 31, 53, 31, 93, 52); i, j, temp, k, min: integer; begin for i := 1 to n do begin a[i] := random(100); write(a[i]:2, ' '); end; writeln; k := 0; for i := 1 to n - 1 do begin for j := i + 1 to n do if a[j] < a [i] then begin temp := a[i]; a[i] := a[j]; a[j] := temp; k := k + 1; end; end; for i := 1 to n do begin write(a[i]:2, ' '); end; writeln; writeln(k); end.
run
|
edit
|
history
|
help
0
Banking
Определение типа треугольника по трём сторонам
practica 1 ejercicio 3
help me to fix this stupid thing, so tired about it
P170808B
Sorting
Thao Vi
ahoj
Бассейн 21 без меток
Find the greatest integers - v2