Program NN; Uses crt; Var A: array[1..10000] of longint; n,i,t,s,d: longint; Begin Clrscr; Write(‘Nhap n: ‘); Readln(n); t:=1; d:=0; s:=0; For i:=1 to n do Begin Read(A[i]); If A[i] mod 5 = 0 then t:=t*A[i]; If A[i] mod 2 = 0 then Begin inc(d); s:=s+A[i]; End; End; Writeln(‘1. ‘,t); Write(‘2. ‘,s/d:0:2); Readln End.
Var A: array[1..250] of integer;
t, s: longint;
n, i, d: byte;
Begin
Write(‘Nhap n: ‘); Readln(n);
t:=1; d:=0; s:=0;
For i:=1 to n do
Begin
Write(‘a[‘, i, ‘] = ‘); Readln(A[i]);
If A[i]<5 = 0 then t:=t*A[i];
If A[i] mod 2 = 0 then
Begin
inc(d);
s:=s+A[i];
End;
End;
Writeln(‘tich = ‘, t);
Write(‘trung binh = ‘, s/d:10:2);
Readln
End.
Program NN;
Uses crt;
Var A: array[1..10000] of longint;
n,i,t,s,d: longint;
Begin
Clrscr;
Write(‘Nhap n: ‘); Readln(n);
t:=1; d:=0; s:=0;
For i:=1 to n do
Begin
Read(A[i]);
If A[i] mod 5 = 0 then t:=t*A[i];
If A[i] mod 2 = 0 then
Begin
inc(d);
s:=s+A[i];
End;
End;
Writeln(‘1. ‘,t);
Write(‘2. ‘,s/d:0:2);
Readln
End.