Program HOC24;
var i,n,k: integer;
a: array[1..32000] of integer;
t: longint;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('Nhap so thu ',i,': '); readln(a[i]);
end;
t:=0;
for i:=1 to n do if (a[i] mod 3=0) and (a[i] mod 5=0) then t:=t+a[i];
write('Tong cac phan tu la boi cua 3 va 5 la: ',t);
readln
end.
Đúng 1
Bình luận (0)