//提示一下繁涂,log2(x)=log(x)/log(2) ?換底公式
#include#include "stdio.h"
#include "math.h"
double logMath(double x)
{
double n;
n = log10(x)/log10(2);
return n;
}
int main(int argc, const char * argv[]) {
// insert code here...
double n;
double x;
printf("請(qǐng)輸入!\n");
scanf("%lf",&x);
n = logMath(x);
printf("計(jì)算結(jié)果是:%.2f\n",n);
return 0;
}