e-olymp
Problems

Bubble sort

published at 2/19/17, 6:40:58 pm

Уточните какие числа в масиве

published at 3/25/18, 12:12:00 pm

В мене якась крива бульбашка -_-

published at 4/18/18, 11:51:06 pm

нерозумію, чому 85%? ніби бульбашка правильна -_-

published at 1/9/19, 9:09:24 pm

var a:array[1..1000] of longint;n,b:longint; procedure Form; var i:longint; begin for i:=1 to n do read(a[i]); end; procedure Bul; var i,j,k:longint; begin b:=0; for i:=1 to n-1 do for j:=1 to n-i do begin if a[j]>a[j+1] then begin k:=a[j]; a[j]:=a[j+1]; a[j+1]:=k; b:=b+1; end; end; end; begin readln(n); Form; Bul; writeln(b); readln; end. Спасибо не надо

published at 1/10/19, 10:50:41 am

var a:array[1..1000] of longint; n,b:longint; procedure Form; var i:longint; begin for i:=1 to n do read(a[i]); end; procedure Bul; var i,j,k:longint; begin b:=0; for i:=1 to n-1 do for j:=1 to n-i do begin if a[j]>a[j+1] then begin k:=a[j]; a[j]:=a[j+1]; a[j+1]:=k; b:=b+1; end; end; end; begin readln(n); Form; Bul; writeln(b); readln; end.