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 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 tam,a,b,i:integer;
begin
write('a = ');readln(a);
write('b = ');readln(b);
if a < b then
begin
tam:=a;
a:=b;
b:=tam;
end;
for i:=a to b do
if sqrt(i) = trunc(sqrt(i)) then write(i:10);
readln;
End.
uses crt;
var n,i,kt,j,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
writeln('Cac so nguyen to trong khoang tu 2 toi ',n,' la: ');
for i:=2 to n do
begin
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;
writeln;
writeln('Cac so chinh phuong trong khoang tu 0 toi ',n,' la: ');
for i:=0 to n do
if trunc(sqrt(i))=sqrt(i) then write(i:4);
writeln;
writeln('Cac so hoan hao trong khoang tu 1 toi ',n,' la: ');
for i:=1 to n do
begin
t:=0;
for j:=1 to i-1 do
if i mod j=0 then t:=t+j;
if t=i then write(i:4);
end;
readln;
end.
Program hotrotinhoc_hoc24;
var i,n: integer;
function nt(x: longint): boolean;
var j: longint;
begin
nt:=true;
if (x=2) or (x=3) then exit;
nt:=false;
if (x=1) or (x mod 2=0) or (x mod 3=0) then exit;
j:=5;
while (j<=trunc(sqrt(x))) do
begin
if (x mod j=0) or (x mod (j+2)=0) then exit;
j:=j+6;
end;
nt:=true;
end;
begin
write('Nhap n='); readln(n);
if nt(n) then writeln(N ,'la so nguyen to') else writeln(N,' khong phai so nguyen to');
write('Cac so nguyen to tu 0 den ',n,' la :');
i:=0;
while i<=n do
begin
i=sqr(trunc(sqrt(i))) then write(i,' ');
i:=i+1;
end;
writeln;
write('Cac so nguyen to tu 2 den ',n,' la :');
i:=2;
while i<=n do
begin
if nt(i) then write(i,' ');
i:=i+1;
end;
readln
end.
uses crt;
var n,kt,s,i,j,k:integer;
{--------------------------------chuong-trinh-con----------------------------------------}
function ktngto(var x:integer):boolean;
var a:integer;
begin
ktngto:=true;
a:=round(sqrt(x));
if n mod a<>0 then ktngto:=false
else ktngto:=true;
end;
{-------------------------------chuong-trinh-chinh------------------------------------}
begin
clrscr;
write('n='); readln(n);
if n>1 then
begin
if ktngto(n)=false then writeln(n,' la so nguyen to')
else writeln(n,' la hop so');
end
else writeln(n,' khong la so nguyen to cung khong la hop so');
if n>=0 then
begin
if n=0 then writeln(0)
else
begin
s:=-1;
while s<=n do
begin
inc(s);
if trunc(sqrt(s))=sqrt(s) then write(s:4);
end;
end;
end;
writeln;
j:=2;
while j<=n do
begin
j:=j+1;
if ktngto(j)=false then write(j:4);
end;
readln;
end.
uses crt;
var n,i,dem,dem1:integer;
begin
clrscr;
write('nhap n='); readln(n);
dem:=0;
dem1:=0;
for i:=1 to n do
begin
if i mod 2=0 then inc(dem);
if i mod 2=1 then inc(dem1);
end;
writeln('so luong so chan trong day so tu 1 toi ',n,' la: ',dem);
writeln('so luong so le trong day so tu 1 toi ',n,' la: ',dem1);
readln;
end.
var n,i:longint;
begin
readln(n);
if n mod 2=0 then write('chan: ',n div 2,' le: ',n div 2) else
write('chan: ',n div 2,' le: ',n div 2+1) ;
end.
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.