C语言中没有以任意为底数的对数函数,所以log5是没有的。所以可以用logx(y)=log(y)/log(x)来代替,修改代码如下#include"stdio.h"#include"math.h"void main(){ double a,b; a=2*3.14-1; b=log(sqrt(a))/log(5); printf("%f\n",b); getchar();}