Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
task 3
program MASSIV4Ik; var a:array[1..100000] of longint; m1,m2,m3,i,n:longint; begin readln(n); for i:=1 to n do read(a[i]); m1:=a[1]; m2:=a[2]; m3:=a[3]; for i:=4 to n do begin if (a[i]<a[1]) or (a[i]<a[2]) or (a[i]<a[3]) then if (m1>m3) and (m1>m2) then m1:=a[i] else if (m3>m1) and (m3>m2) then m3:=a[i] else if (m2>m3) and (m2>m1) then m2:=a[i] end; if (m1>m2) and (m1>m3) then if m3>m2 then write(m2,' ',m3,' ',m1) else writeln(m3,' ',m2,' ',m2) else if (m2>m1) and (m2>m3) then if m1>m3 then writeln(m3,' ',m1,' ',m2) else writeln(m1,' ',m3,' ',m2) else if (m3>m2) and (m3>m1) then if m2>m1 then writeln(m1,' ',m2,' ',m3) else writeln(m2,' ',m1,' ',m3); end.
run
|
edit
|
history
|
help
0
BubbleSor (slimmer)
Сумма пар чисел кратных и некратных 11 с дельтой неэффективная
6
LogOp2
Compteur
janja - naloga 1 - 11.7.2013
Pokazivac-dinamicka alokacija memorije
pascal1
считалочка06
test08