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.
uses crt;
var i,n,dem:integer;
begin
clrscr;
readln(n);
dem:=0;
i:=1;
while i<=n do
begin
if trunc(sqrt(i))=sqrt(i) then begin inc(dem); write(i:4);
end;
i:=i+1;
end;
writeln;
writeln(dem);
readln;
end.
uses crt;
var n,i,kt,j:integer;
begin
clrscr;
readln(n);
i:=1;
while (i<n) do
begin
i:=i+1;
kt:=0;
for j:=2 to i-1 do
if i mod j=0 then kt:=1;
if kt=0 then write(i:4);
end;
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.
Var i,n:integer;
Begin
Write('n = ');readln(n);
Write('Day so tu 1 den ',n,' la ');
For i:=1 to n do write(i:8);
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:integer;
begin
write('n = ');readln(n);
i:=2;
while n mod i <> 0 do i:=i+1;
if i = n then write(n,' la so nguyen to')
else write(n,' khong la so nguyen to');
readln
end.
Uses crt;
var i,n,p: integer;
begin clrscr;
readln(n);
for i:=1 to n do if(n mod i=0) then p:=p+1;
if(p=2) then writeln(n,' la so nguyen to')
else writeln(n,' khong phai la so nguyen to');
readln;
end.
program TinhTongVaUoc;
var
a, b, sum, i: integer;
uoc: boolean;
begin
write('Nhap so a: ');
readln(a);
write('Nhap so b: ');
readln(b);
// Tinh tong a+b
sum := a + b;
writeln('Tong cua a va b la: ', sum);
// In ra cac uoc cua tong
write('Cac uoc cua tong a+b la: ');
for i := 1 to sum do
begin
if sum mod i = 0 then
write(i, ' ');
end;
writeln;
// Kiem tra xem tong a+b co phai la so hoan hao hay khong
uoc := false;
for i := 1 to sum - 1 do
begin
if sum mod i = 0 then
uoc := true;
end;
if uoc and (sum = 2 * sum div 2) then
writeln('Tong a+b la so hoan hao')
else
writeln('Tong a+b khong phai la so hoan hao');
end.