UVA 11636 话不多说,直接贴代码 #include <iostream> using namespace std; int main() { ios::sync_with_stdio(0),cin.tie(0); int n; int cnt=1; while(cin>>n&&n>=0) { int res=0; int f=1; while(f<n) { f=f*2; res++; } cout<<"Case "<<cnt++<<": "; cout<<res<<endl; } return 0; }