This website requires Javascript to function properly. Please go to the setting of your web browser and enable Javascript for this website.
×
Loading...
Close
Home
Share
lol 要是当数学题做,就直接 google 吧--目前还是猜想。
xmlhttprequest
(build5381)
(#11942688@0)
Last Updated: 2019-2-20
This post has been archived. It cannot be replied.
Share
Share Online by QR Code
Report
Replies, comments and Discussions:
工作学习
/
学科技术
/
以下程序有可能会死循环吗?
-
sxffff
(lookingforjob);
2019-2-20
{135}
(#11941799@0)
var a = new java.util.Random().nextInt(100000)
while (a!=1){
if (a%2==0){
a=a/2
} else {
a= a*3+1
}
print(a)
}
print(a)
这个范围 --- 穷举一遍不就知道了?
-
xmlhttprequest
(build5381);
2019-2-20
(#11942392@0)
这是数学题,𣎴要穷举
-
sxffff
(lookingforjob);
2019-2-20
(#11942530@0)
编程序不就是为了穷举?
-
guestagain
(guest again);
2019-2-20
(#11942608@0)
lol 要是当数学题做,就直接 google 吧--目前还是猜想。
-
xmlhttprequest
(build5381);
2019-2-20
(#11942688@0)
a如果是0,不就是死循环了吗?
-
padawan2018
(Padawan);
2019-2-20
(#11942653@0)
+1
最后都会落在2的N次方,a 最终会等于1, 所以不会死循环,除0以外。说冰雹猜想就相当于人一生的折腾,不会far off吧?
-
hashicorp1
(Consul);
2019-2-24
(#11948259@0)
+1
这是collatz猜想,虽然目前世界上没有证明,但是对于这么小的范围都是成立的,也就是说你这题最终会到1而跳出循环。
-
zhengy4
(zhengy4);
2019-2-24
(#11948546@0)
+3
More Topics
Grok
OpenAI 前員工自創公司推世上最強AI?GPT-4、Claude3、Gemini pro 1.5 三強鼎立,到底哪個最好用?ft.泛科學院【思想實驗室】
We cannot solve our problems with the same thinking we used when we created them (Albert Einstein).
不懂就问: 为何 Python 和一些语言, 把字符串的 index 设计的这么麻烦难用? 比如 ABCDE, index is 01234 from left or -5-4-3-2-1 from right? 这样做的好处是什么? 还有 left inclusive but right exclusive… 真复杂啊
求建议:一个小型数控机床,
枫下论坛主坛
/
工作学习
/
学科技术