t1 = Time.now.to_i min = Math.sqrt(1).to_i max = Math.sqrt(10**14).to_i def isH(num) num = num.to_s return num == num.reverse end for num in (min..max) if isH num z = num**2 if isH z puts z end end end t2 = Time.now.to_i puts t2-t1
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....