Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
var a:array[1..1000] of integer;
i,n,d:integer;
begin
write('n = ');readln(n);
for i:=1 to n do
begin
write('nhap so thu ',i,' = ');readln(a[i]);
if a[i] mod 2 <> 0 then d:=d+1;
end;
write('Cac so o vi tri le la ');
for i:=1 to n do
if i mod 2 <> 0 then write(a[i]:8);
writeln;
write('co ',d,' so le');
readln
end.
Var a:array[1..200] of integer;
i,n,dem:integer;
Begin
Write('Nhap so luong phan tu n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap phan tu thu ',i,' = ');readln(a[i]);
End;
dem:=0;
For i:=1 to n do
If a[i]>5 then dem:=dem+1;
Write('So phan tu lon hon 5 la ',dem);
Readln;
End.
uses crt;
var a:array[1..100]of integer;
i,n,dem,t:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
begin
readln(a[i]);
end;
for i:=1 to n do
write(a[i]:4);
readln;
dem:=0;
t:=0;
for i:=1 to n do
if a[i] mod 10=0 then
begin
write(a[i]:4);
inc(dem);
t:=t+a[i];
end;
writeln;
writeln(dem);
writeln(t);
readln;
end.
Program HOC24;
var d,i,n: integer;
a: array[1..32000] of integer;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
write('Cac phan tu cua mang vua nhap la: ');
for i:=1 to n do write(a[i],' ');
writeln;
d:=0;
for i:=1 to n do if 10 mod a[i]=0 then d:=d+1;
writeln('Co ',d,' phan tu co gia tri la uoc cua 10');
write('Cac phan tu o vi tri chan la: ');
for i:=1 to n do if i mod 2=0 then write(a[i],' ');
writeln;
write('Cac phan tu o vi tri le la: ');
for i:=1 to n do if i mod 2=1 then write(a[i],' ');
readln
end.
program TongSoChiaHetCho5;
var
n, i, x, tong: integer;
begin
write('Nhap so phan tu n: ');
readln(n);
tong := 0;
for i := 1 to n do
begin
write('Nhap phan tu thu ', i, ': ');
readln(x);
if (x > 0) and (x mod 5 = 0) then
tong := tong + x;
end;
writeln('Tong cac so lon hon 0 va chia het cho 5 la: ', tong);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,t,dem:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
if a[i] mod 6=0 then t:=t+a[i];
writeln('Tong cac so chia het cho 3 va 6 la: ',t);
for i:=1 to n do
if a[i]>3 then write(a[i]:4);
writeln;
for i:=1 to n do
write(a[i]:4);
dem:=0;
for i:=1 to n do
if (a[i] mod 2<>0) and (a[i] mod 5=0) then inc(dem);
writeln(dem);
readln;
end.
cảm mơn bạn :D