level 6
现在由于使用的是integer数据类型,所以最大只能找到65535以下的亲和数,等周末再修改。
2014年04月24日 10点04分
6
integer不是 -2147483648 到 2147483647 吗?
2014年04月30日 11点04分
level 11
终于有人发贴了!我表示很欣慰!(还有,吧主都不在了,还怎么加精。。。)
2014年04月30日 09点04分
8
level 11
LZ肯定和我一样,也是搞信息奥赛的小学生吧。。。我想说一句,你的变量名最好起成英文单词, 最好见名知义,对以后搞程序有很大的帮助~
2014年04月30日 09点04分
9
做的挺好的,继续努力!
2014年04月30日 09点04分
虽然是小学生……但不搞奥赛……我本想劳动节优化……没想到你抢先了……
2014年04月30日 11点04分
回复 justintangd :我一部分信息知识用于搞奥赛,剩下的95%都用来造电脑游戏(有2D有3D有控制台有GUI,全部FreeBASIC制作)
2014年04月30日 11点04分
level 11
dim a as integer
dim b as integer
dim c as integer
dim e as integer
dim f as integer
dim h as integer
input a
dim t as double = timer
open "运行结果.txt" for output as #1
for b = 220 to a
e=1
h=1
for c = 2 to sqr(b)
if b mod c=0 then
e=e+c+b/c
end if
next c
for f = 2 to sqr(e)
if e mod f=0 then
h=h+f+e/f
end if
next f
if h=b then
print #1,b,e
print b,e
end if
next b
print "用时";timer-t;"秒"
sleep
close #1
end
2014年04月30日 11点04分
15
level 6
sqr函数是用来干嘛的?我还没学………………………………
2014年04月30日 12点04分
17