uses crt; var A:array[1..100] of integer; i,n,dem:integer; begin clrscr; write(‘Nhap n: ‘); readln(n); for i:=1 to n do begin write(‘Nhap phan tu thu ‘,i,’: ‘); readln(A[i]); if A[i] mod 3 <> 0 then inc(dem); end; write(‘Co ‘,dem,’ phan tu khong chia het cho 3′); readln end.
Program bt;
Uses crt;
Var A; array[1..100] of Integer;
N,i,d: integer;
Begin
clrscr;
Write(‘ Nhap so phan tu cua mang: ‘); 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;
Writeln(‘ So phan tu khong chia het cho 3 la: ‘,d);
Readln
End.
uses crt;
var A:array[1..100] of integer;
i,n,dem:integer;
begin
clrscr;
write(‘Nhap n: ‘); readln(n);
for i:=1 to n do
begin
write(‘Nhap phan tu thu ‘,i,’: ‘);
readln(A[i]);
if A[i] mod 3 <> 0 then inc(dem);
end;
write(‘Co ‘,dem,’ phan tu khong chia het cho 3′);
readln
end.