请问这个C++程序有什么错误?(求f(x) = x^2+5x-6在【3,5】区间上的积分值.)#include using namespace std;int main(){double n = (5 - 3) / 100,sum = 0; for (double beg = 3,end = beg + n,y1,y2; beg
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 19:39:33
xRN@Iܴ7T\&@i4a4B FDbB<>vZVBt#!.ܸɹ̹9xeRӿuԭZ3ݚTVk'y'" A/^wtYPv^
rasf=0VE S 2%$Ĉ !AĬOK b" D9Vqť.h ixPٿN磟2wPsd_l.*teNw}<99-h< ֢)zyݣ.P۰uҖYsݖn9#xd0-~
请问这个C++程序有什么错误?(求f(x) = x^2+5x-6在【3,5】区间上的积分值.)#include using namespace std;int main(){double n = (5 - 3) / 100,sum = 0; for (double beg = 3,end = beg + n,y1,y2; beg
请问这个C++程序有什么错误?(求f(x) = x^2+5x-6在【3,5】区间上的积分值.)
#include
using namespace std;
int main()
{
double n = (5 - 3) / 100,sum = 0;
for (double beg = 3,end = beg + n,y1,y2; beg
请问这个C++程序有什么错误?(求f(x) = x^2+5x-6在【3,5】区间上的积分值.)#include using namespace std;int main(){double n = (5 - 3) / 100,sum = 0; for (double beg = 3,end = beg + n,y1,y2; beg
double n = (5 - 3) / 100,sum = 0; 该为double n = (5 - 3) / 100.0,
sum += (y1 + y2) * n / 2改为sum += (y1 + y2) * n / 2.0
这样计算出来的结果才是小数,不然计算结果是整数.