1.
Program FNG;
Uses crt;
Var A: array[1..1000] of longint;
n,i,s: longint;
Begin
Clrscr;
Writeln ('Nhap n: '); Readln(n);
s:=1;
For i:=1 to n do
Begin
Write('A[',i,'] = ');
Readln(A[i]);
If A[i] mod 5 = 0 then s:=s*A[i];
End;
Write('S = ',s);
Readln
End.
2.
Program FNG;
Uses crt;
Var A: array[1..1000] of longint;
n,i,s: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
s:=0;
For i:=1 to n do
Begin
Write('A[',i,'] = ');
Readln(A[i]);
If A[i]<=5 then s:=s+A[i];
End;
Write('S = ',s);
Readln
End.
3.
Program FNG;
Uses crt;
Var A: array[1..1000] of longint;
n,i,s: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
s:=0;
For i:=1 to n do
Begin
Write('A[',i,'] = ');
Readln(A[i]);
If A[i]>0 then s:=s+sqr(A[i]);
End;
Write('S = ',s);
Readln
End.
Well Learn!