标签:font cout 可见 include end out namespace 输出 nbsp
3 1 0
5 0
#include<iostream> using namespace std; int change(int x){ if(x%2==0) return x/2; else return (3*x+1)/2; } int main(){ int n; while(cin>>n){ if(n==0) break; int i=0; while(n!=1){ n=change(n); i++; } cout<<i<<endl; } return 0; }
标签:font cout 可见 include end out namespace 输出 nbsp
原文地址:https://www.cnblogs.com/bernieloveslife/p/9736570.html