- #include<iostream>
- using namespace std;
- int main ()
- {
- int pastes , N , lines;
- int i = 0;
- while(cin>>N)
- {
- i++;
- lines = 1;
- pastes = 0;
- if(N<0)
- break;
- else if(N == 1)
- {
- pastes = 0;
- }
- else
- {
- while(true)
- {
- lines *=2;
- if(lines >= N)
- {
- pastes++;
- break;
- }
- else
- pastes++;
- }
- }
- cout<<"Case "<<i<<": "<<pastes<<endl;
- }
- return 0;
- }
You can find more of my solutions on Here
No comments:
Post a Comment