Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76966 Kevin 角谷猜想 C++ Accepted 6 MS 268 KB 275 2024-06-07 15:15:05

Tests(5/5):


Code:

#include<iostream> #include<cmath> using namespace std; int main(){ long long n; cin>>n; while(n!=1){ if(n%2){ cout<<n<<"*3+1="<<n*3+1<<endl; n=n*3+1; } else{ cout<<n<<"/2="<<n/2<<endl; n=n/2; } } if(n==1) cout<<"End"; return 0; }