角谷猜想-拓展题
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
编写一个程序,要求输入一个整数,将经过下述处理得到1的过程输出来。
角谷猜想指对于任意一个正整数,如果是奇数,则乘3加1,如果是偶数,则除以2,得到的结果再按照上述规则重复处理,最终总能够得到1。如,假定初始整数为5,计算过程分别为16、8、4、2、1。
输入输出说明
输入说明
一个正整数N(N <= 2,000,000)。
输出说明
从输入整数到1的步骤,每一步为一行,每一部中描述计算过程。最后一行输出"End"。如果输入为1,直接输出"End"。
题目样例
样例输入
5
样例输出
5*3+1=16
16/2=8
8/2=4
4/2=2
2/2=1
End
菜就使劲练!!!
- Status
- Done
- Rule
- XCPC
- Problem
- 11
- Start at
- 2024-8-16 13:30
- End at
- 2024-8-16 17:00
- Duration
- 3.5 hour(s)
- Host
- Partic.
- 10