标签:font std cep ott 16px 一半 bit sam search
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4606 Accepted Submission(s): 3333
1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int n; 6 int ans; 7 while(cin>>n&&n) 8 { 9 ans=0; 10 if(n==1)ans=0; 11 else 12 { 13 while(n>1) 14 { 15 if(n%2==0) 16 { 17 n/=2; 18 ans++; 19 } 20 else 21 { 22 n=n*3+1; 23 n/=2; 24 ans++; 25 } 26 } 27 } 28 cout<<ans<<endl; 29 } 30 return 0; 31 }
标签:font std cep ott 16px 一半 bit sam search
原文地址:http://www.cnblogs.com/ECJTUACM-873284962/p/6366223.html