看板Programming
标 题Re: [求救]C语言判断正整数
发信站KKCITY (Wed Apr 2 02:48:19 2008)
转信站ptt!ctu-reader!ctu-peer!ctu-gate!news.nctu!news.ncu!news.yzu!zoonews.e
※ 引述《[email protected] (龙龙)》之铭言:
> 请问各位大大有什麽方法可以判断出所输入的数值经过开n次平方根之後
> 得出来的数值为正整数(既没有小数点)...
> 拜托了~~
自己写质因数分解
求出来如:16777216 = 2^24,24/2/2/2 = 3,再除不尽
便知他可以开平方根三次
分解前要先建一个质数表,建到sqrt(maxint)[通常等於2^16]就好
不用多建
> 救命的
> 谢谢
不谢
--
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
For the country must we secure all the advantages, but after the party!
ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ
─ journeyman ─
SCA v2
--
┌─────◆KKCITY◆─────┐ ◢╱ 只要你
通过身份认证 ~ ◥█
│ bbs.kkcity.com.tw │ █▉─ 免经验、五人连署即开班系板 ◥
└──《From:59.115.202.85
》──┘ ◥╲ 赶快为班上设个
秘密基地吧!
◢
--