#include
#include
void main()
{
float x;
scanf("%f",&x);
(x<=(float)0)?printf("输入有误!"):printf("lgx=%f",log10(x));
}
运行示例截图:
#include
#include
void main()
{
float x;
scanf("%f",&x);
(x<=(float)0)?printf("输入有误!"):printf("lgx=%f",log10(x));
}
运行示例截图: