Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Пузырькова сортировка
{ Пузырькова сортировка. } 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] := n-i+1; // random(100); write(a[i]:2, ' '); end; writeln; for i := 1 to n do for j := 1 to n - i do if a[j] > a[j+1] then begin temp := a[j]; a[j] := a[j+1]; a[j+1] := temp; end; for i := 1 to n do write(a[i]:2, ' '); writeln; end.
run
|
edit
|
history
|
help
0
P170808A
Tri 1.0
fgh
mult_matrix.pas
temp
contar_divisores_de_N
testMatrice0.1
Régua Para tanque cilindrico horizontal
Quadratic equation
Multiplicação de Matrizes