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.
program tim_uoc;
uses crt;
var i,n,tong:integer;
begin
clrscr;
write('nhap so n:');readln(n);
i:=1;tong:=0;
writeln('cac uoc cua ',n,' la:');
while i<=n do
if n mod i=0 then
begin
write(i:3);
inc(i);
end;
writeln;
i:=1;writeln('cac uoc chan:');
while i<=n do
begin
if n mod i=0 then
begin
if i mod 2=0 then write(i:3);
tong:=tong+i;
end;
end;
writeln;
write('tong cac uoc chan:',tong);
readln;
end.
uses crt;
var n,i,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
i:=1;
writeln('Cac uoc cua ',n,' la: ');
while i<=n do
begin
if n mod i=0 then write(i:4):
i:=i+1;
end;
writeln;
writeln('Cac uoc chan cua ',n,' la: ');
t:=0;
i:=1;
while i<=n do
begin
if (n mod i=0) then
begin
t:=t+i;
write(i:4);
end;
inc(i);
end;
writeln('Tong cac uoc chan cua ',n,' la: ',t);
readln;
end.
var n, sum : integer;
begin
write('Nhap n: ');
readln(n);
sum := 0;
while n > 0 do
begin
sum := sum + n;
n := n - 1;
end;
writeln('Tong la: ', sum);
end.
program Le_Nho_Hon_Hoac_Bang_n;
uses crt;
var
n, i: integer;
begin
clrscr;
write('Nhap vao mot so nguyen duong n: ');
readln(n);
while n <= 0 do
begin
writeln('So ban nhap khong hop le. Xin vui long nhap lai: ');
readln(n);
end;
clrscr;
writeln('Cac so le nho hon hoac bang ', n, ' la:');
i := 1;
while i <= n do
begin
if i mod 2 <> 0 then
writeln(i);
i := i + 1;
end;
readln;
end.
program TinhTongTich;
var
N, i, Tong, Tich:integer;
begin
writeln('Nhap so nguyen duong N:');
readln(N);
i:=1;
Tong:=0;
Tich:=1;
while i<=N do
begin
Tong:=Tong+i;
Tich:=Tich*i;
i:=i+1;
end;
writeln('Tong cac so tu 1 den ', N, ' la: ', Tong);
writeln('Tich cac so tu 1 den ', N, ' la: ', Tich);
readln;
end.
var i,n,s,du,dem:integer;
Begin
While n<=0 do
Begin
Write('N = ');readln(n);
End;
For i:=1 to n do
If n mod i = 0 then
Begin
Write(i:7);
du:=du+1;
s:=s+i;
End;
Writeln('So uoc cua ',n,' la ',du);
Writeln('Tong cac uoc cua ',n,' la ',s);
For i:=1 to s do
If s mod i = 0 then dem:=dem+1;
If dem=2 then write(s,' la so nguyen to')
Else write(s,' khong la so nguyen to');
Readln;
End.
uses crt;
var i,n:integer;
begin
clrscr;
readln(n);
for i:=1 to n do if n mod i=0 then write(i:4);
readln;
end.