Program HOC24;
var i,n: integer;
a: array[1..32000] of integer;
d: integer;
begin
write('Nhap n: '); readln(n);
d:=0;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
if a[i] mod 3=0 then d:=d+1;
end;
write('Co ',d,' phan tu la boi cua 3');
readln
end.
Đúng 1
Bình luận (0)
uses crt;
var i,n,dem:integer;
a:array[1..100] of integer;
begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
dem:=0;
for i:=1 to n do
if a[i] mod 3=0 then inc(dem);
writeln(dem);
readln;
end.
Đúng 0
Bình luận (0)