Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
AR sredine
program aritmetickaSredina; var a:array[1..50] of real; p,q,i,n,v,m:integer; ar,pom,sum:real; begin writeln('Koliko elemeata ima niz: '); read(n); writeln('Unesite elemente niza: '); i:=1; ar:=0; while(i<=n) do begin read(a[i]); if (a[i]>=0) then begin ar:=ar+a[i]; i:=i+1 end end; v:=0;m:=0; writeln('Parovi (p,q) su : '); for p:=1 to n do for q:=1 to n do if not(p=q) then begin sum:=a[p]+a[q]; sum:=sum/2; pom:=ar-a[p]-a[q]; pom:=pom/(n-2); if (pom>sum) then begin writeln('(',a[p]:0:2,',',a[q]:0:2,') manja'); m:=m+1 end else if(pom<sum) then begin writeln('(',a[p]:0:2,',',a[q]:0:2,') veca'); v:=v+1 end end; writeln('Manjih ima ',m); writeln('Vecih ima ',v); end.
run
|
edit
|
history
|
help
0
RENAN COSTA CARLOS DA CUNHA 600623343
zadan 2
LewisCableCompanyPasprogramme
Matrix
Prova 1
mult_matrix.pas
1º Questão - VS - 1º Semestre 2017
Сумма пар чисел кратных и некратных 11
Huong11a2@
test27