简介:
输出多条Hello World,只能复制粘贴
分析:
实际上我们只要贪心的一直复制
得到的Hello world的条数一定是2的n次方
最后差几条,我们直接用一次复制即可
//这里写代码片
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
int cas=0,n;
while (scanf("%d",&n)&&n!=-1)
{
if (n==0)
{
printf("Case %d: 0\n",++cas);
continue;
}
printf("Case %d: ",++cas);
int t=1,ans=0;
while (t<n)
{
t*=2;
ans++;
}
printf("%d\n",ans);
}
return 0;
}