作业帮 > 综合 > 作业

PASCAL试题急!任给一个自然数n(n

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/05/14 04:30:04
PASCAL试题急!
任给一个自然数n(n
PASCAL试题急!任给一个自然数n(n
已全部补充完整,请查收
1
var n,i,s:int64;
begin
readln(n);
i:=2;
s:=0;
while i100000 then break;
end;
if s>100000 then continue;
if not a[s] and (si) then
begin
for j:=1 to s div 2 do
if s mod j=0 then
begin
w:=w+j;
if w>100000 then break;
end;
if w>100000 then continue;
if w=i then
begin
a[i]:=true;a[s]:=true;
writeln(i,' ',s);
end;
end;
end;
end;
end.
3
var i,j,n,s:longint;
begin
readln(n);
for i:=1 to n do
begin
s:=0;
for j:=1 to i div 2 do
if i mod j=0 then s:=s+j;
if s=i then writeln(i);
end;
end.
4
var s:real;
i,k:integer;
begin
readln(k);
s:=0; i:=1;
while s