我正在尝试做一个“DEV C++”编译器的指数示例,但无法获得输出
这是代码:
#include <stdio.h>
#include <math.h>
int main (void)
{
double base, exponent, result;
printf("La base:\n");
scanf("%lf",&base);
printf("El exponente:\n");
scanf("%lf",&exponent);
result = pow(base, exponent);
printf("%.1lf^%.1lf = %.21f", base, exponent, result);
return 0;
}
我明白了:
可能是什么问题?
真诚的, 宁。
最佳答案
您向我们展示了 exponente.c
中的代码(我猜),但屏幕截图中的错误消息显示:
error in math.h
included from teorema.c
因此,您应该非常仔细地阅读错误消息,并在其他文件中查找有错误的代码。
关于c - 我正在尝试用 c 计算指数,但这就是得到的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38577766/