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.
![](https://rs.olm.vn/images/avt/0.png?1311)
program DemSoChiaHetCho5;
var
n, i, count: integer;
begin
write('Nhap n: ');
readln(n);
i := 1;
count := 0;
while i <= n do
begin
if i mod 5 = 0 then
count := count + 1;
i := i + 1;
end;
writeln('Co ', count, ' so tu nhien chia het cho 5 trong khoang tu 1 den ', n);
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var i,n,s:integer;
begin
clrscr;
readln(n);
s:=0;
i:=0;
while i<=n do
begin
i:=i+1;
s:=s+i*i;
end;
writeln(s);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var n,i,t,x:integer;
begin
clrscr;
readln(n);
t:=0;
while n>0 do
begin
x:=n mod 10;
if x mod 2=0 then t:=t+x;
n:=n div 10;
end;
writeln(t);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Tham khảo:
Program BTH;
uses crt;
var i,n,s:longint;
Begin
clrscr;
write('Nhap n: ');readln(n);
i:=1;
While i<>n do
Begin
If i mod 2=0 then s:=s+i;
i:=i+1;
end;
writeln('Tong day so tren la: ',s);
readln;
end.
program tinh_tong_chan;
uses crt;
Var i,N,S: integer;
begin
clrscr;
writeln('nhap so n');
readln(N);
S:=0;
i:=1;
while i <= N do
begin
S:=S+i;
i:=i+1;
end;
Writeln('tong la: ',S);
readln;
end.
đây bạn nha
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
i:=1;
while i<=n do
begin
t:=t+a[i];
inc(i);
end;
writeln(t/n:4:2);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Var i,n,p:longint;
Begin
Write('Nhap n = ');readln(n);
i:=1;
p:=1;
While i<=n do
Begin
i:=i+1;
p:=p*i;
End;
Write('Tich la ',p);
Readln;
End.
program DemSoChiaHetCho5;
var
n, count, i: integer;
begin
write('Nhap vao so n: ');
readln(n);
count := 0;
i := 1;
while i <= n do
begin
if i mod 5 = 0 then // kiem tra so i co chia het cho 5 khong
count := count + 1;
i := i + 1;
end;
writeln('So luong so tu nhien chia het cho 5 tu 1 den ', n, ' la: ', count);
end.
c.mơn bn.