0 дауыс
4.7k көрілді

A[A1,A2,..A8],

B[B1,B2,..B5],

C[C1,C2,..C4].

2 жауап

+2 дауыс
 
Жақсы жауап
program n1;
uses crt;
var a:array[1..3,1..3] of integer;
    b:array[1..1000] of integer;
     i,j,S,l:integer;  k:real;
begin
         clrscr;
         S:=0;
         l:=0;
         for i:=1 to 3 do
         for j:=1 to 3 do
         read(a[i,j]);

         for i:=1 to 3 do
         for j:=1 to 3 do
         if a[i,j]>0 then begin
                          inc(l);
                          S:=S+a[i,j];
                          end;
         k:=s/l;
         writeln(k);

end.
+2 дауыс
int A[] = new int [8];
int k=0;
double s=0;
for(int i=0;i<A.length;i++)
          if(a[i]>0)
{
        sum+=a[i];
         k++;
}
s=sum/k;
...