- 【例35.2】 角谷猜想
123
- 2025-3-24 10:39:03 @
#include<bits/stdc++.h> using namespace std; int n; int main(){ cin>>n; for(;n>1;){ if (n%2==0){ cout<<n<<"/2="<<n/2<<endl; n/=2; } else{ cout<<n<<"3+1="<<n3+1<<endl; n*=3; n++; } } cout<<"End"; return 0; }
0 comments
No comments so far...
Information
- ID
- 123
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- # Submissions
- 27
- Accepted
- 12
- Uploaded By