作业题
#include <stdio.h>#include <math.h>
int main()
{
float d=300000,p = 6000,r = 0.01,m;
m = lg10(p/(p-d*r)/lg10(1+r));
printf(" m = %6.1f\n",m);
}
调试无error。CTRL+F5后报error,怎么解决
--------------------Configuration: 049 - Win32 Debug--------------------
Linking...
049.obj : error LNK2001: unresolved external symbol _lg10
Debug/049.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
049.exe - 1 error(s), 0 warning(s)
#include <stdio.h>
#include <math.h>
int main()
{
float d = 300000, p = 6000, r = 0.01, m;
m = log10(p / (p - d * r) / log10(1 + r));
printf(" m = %6.1f\n", m);
} 是log10不是lg10 baige 发表于 2020-8-12 22:55
是log10不是lg10
书上写的输出答案是69.7 咱们输出的是2.7 本帖最后由 baige 于 2020-8-12 23:35 编辑
百年孤独i 发表于 2020-8-12 23:29
书上写的输出答案是69.7 咱们输出的是2.7
{:10_277:} #include <stdio.h>
#include <math.h>
int main()
{
float d = 300000, p = 6000, r = 0.01, m;
m = log10(p / (p - d * r)) / log10(1 + r);
printf(" m = %6.1f\n", m);
}
你括号的问题,已修改
m = log10(p / (p - d * r)) / log10(1 + r);
你对比一下就知道了 问题解决的话就结贴吧。{:10_277:}
页:
[1]