Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
1118 曾浩森 角谷猜想 C++ Accepted 2 MS 256 KB 376 2023-07-10 15:30:01

Tests(5/5):


Code:

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