标签:
1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 int main() 5 { 6 int N; 7 while(cin>>N) 8 { 9 int n=1; 10 int i=1; 11 while(n!=(N+1)) 12 { 13 if(n<=N) 14 { 15 n=n*2; 16 i++; 17 } 18 else 19 { 20 n=(n-N)*2-1; 21 i++; 22 } 23 } 24 cout<<i<<endl; 25 } 26 }
标签:
原文地址:http://www.cnblogs.com/a1225234/p/4591255.html