Code: Select all
remove after A/C
Moderator: Board moderators
Code: Select all
remove after A/C
Here we are all childaionkinahwowgold wrote:Do you want to monitor what your kids are doing online? Do they chat with ill-intentioned strangers?
Do you doubt that your emoplyees are busy with personal affairs during work-time? Are they trying to copy out company confidential data?
All you need is a smart Internet usage monitoring software to keep an eye on your children and workers. EAM - Employee Internet monitoring software is an ideal choice in this case.
Input is terminated by a line containing a negative integer.
Code: Select all
#include <stdio.h>
int j=1;
int power(int i){
int k;
int l=1;
for(k=0;k<i;k++)
l=2*l;
return l;
}
int main(){
int n,p;
while( scanf("%d",&n)==1 && (n!=-1) ){
p=1;
while(power(p)<n)
p++;
if(n==1)
printf("Case %d: 0\n",j);
else
printf("Case %d: %d\n",j,p);
j++;
}
return 0;
}
One mistake we programmer's often did is that "We think negative integer = -1"Input is terminated by a line containing a negative integer.
Code: Select all
Got AC