Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
1113 曾浩森 角谷猜想 C++ Wrong Answer 0 MS 260 KB 342 2023-07-10 15:27:04

Tests(0/5):


Code:

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


Run Info:

------Input------
10
------Answer-----
10/2=5 5*3+1=16 16/2=8 8/2=4 4/2=2 2/2=1 End
------Your output-----
10/2=5 16/2=8 8/2=4 4/2=2 2/2=1 End