1樓:聽不清啊
var n,i:longint;
function sum(k:longint):longint;
var i,s:longint;
begin
s:=0; i:=2;
while k>1 do
begin
while k mod i=0 do begin s:=s+i; k:=k div i; end;
inc(i);
end;
sum:=s;
end;
begin
readln(n);
for i:=1 to n do
if sum(i)=i then writeln(i);
end.
2樓:匿名使用者
varn,m,i:longint;
function f(x:longint):boolean;
vari,s,t:longint;
begin
i:=1; s:=0; t:=x;
while x>1 do
begin
inc(i);
while x mod i=0 do
begin
x:=x div i;
s:=s+i;
end;
end;
if t mod s=0 then exit(true) else exit(false);
end;
begin
read(n,m);
for i:=n to m do
if f(i) then writeln(i);
end.
PASCAL簡單的題目,求答案
type ta array 1.10 of integer function arrmax arr ta n integer integer begin if n 1 then result arr 1 else result max arrmax arr,n 1 arr n end vara ta...
求PASCAL題目的答案,用比較簡單的方法的出答案,在解釋一
絕 w 醒 角谷猜想 vara longint begin readln a while a 1 do begin if a mod 2 0 then begin writeln a,2 a div 2 a a div 2 end else begin writeln a,3 1 a a 1 a a...
急求c 題目答案答案,非常感謝
原創 vc6.0測試過 include include class mystring mystring mystring mystring mystring char p this str new char i 1 this array len i 1 this str len i for int ...