#include <stdio.h>
int main(){
int x,ret=0,t;
printf(“请输入正整数”);
scanf("%d",&x);
t=x;
while(x>1){
x/=2;
ret++;
}
printf(“log2 of %d is %d”,t,ret);
return 0;
}
求 对数 log2-x
最新推荐文章于 2021-11-27 23:31:09 发布
#include <stdio.h>
int main(){
int x,ret=0,t;
printf(“请输入正整数”);
scanf("%d",&x);
t=x;
while(x>1){
x/=2;
ret++;
}
printf(“log2 of %d is %d”,t,ret);
return 0;
}