hello女神成都:pascal编程求正整数A和B之间的完全数
来源:百度文库 编辑:查人人中国名人网 时间:2024/05/04 10:40:51
program l_1(input,output);
type
cc=record
data,total:integer;
end;
var
a,b,i,he:integer;
bt:array[1..1000] of cc;
function fac(a:integer):integer;
var
i:integer;
begin
fac:=0;
for i:=1 to a-1 do
if a mod i=0 then fac:=fac+i;
end;
begin
he:=0;
assign(input,'work1_3.in');
reset(input);
assign(output,'work1_3.out');
rewrite(output);
readln(a,b);
for i:=a to b do
begin
bt[i-a+1].data:=i;
bt[i-a+1].total:=fac(i);
if fac(i)=i then inc(he);
end;
writeln(he);
for i:=1 to b-a+1 do
if bt[i].data=bt[i].total then writeln(bt[i].data);
close(input);
close(output);
end.
都是枚举
若比n小的正因数之和等于n,则n称为完全数
pascal编程求正整数A和B之间的完全数
C编程:已知AB为正整数,A<B,A*B=716699要求A+B取最小值,求满足条件的A值.
pascal编程:读入两个数a,b(0<a,b<30000),输出它们的和。
用While语句求A~B之间的整数和。
已知 根号a+根号b=根号333 ;求a,b的正整数解。
已知A.B为正整数,且满足A*B/8>A,A*B/10<A,求B的值
A和B之间的区别是什么?
已知a b为正整数,且满足(a+b)/(a平方+ab+b平方)=4/49 求a b 的值
已知a,b,c为不相等的正整数,且a^2+b^3=c^4,求c的最小值。
已知:A,B,C为正整数,且有A^2+B^3=C^4,求c的最小值