帮忙看看这段程序哪错了,非常感激!#include #include double f(double x) { double y;#include#includedouble f(double x){double y;y=sin(x);y=y/x;return y;}void main(){double a,b,r,h,z,n;int k,j;double p[50][50];printf("Please input'a=?,b=?,r
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/31 02:38:10
帮忙看看这段程序哪错了,非常感激!#include #include double f(double x) { double y;#include#includedouble f(double x){double y;y=sin(x);y=y/x;return y;}void main(){double a,b,r,h,z,n;int k,j;double p[50][50];printf("Please input'a=?,b=?,r
帮忙看看这段程序哪错了,非常感激!#include #include double f(double x) { double y;
#include
#include
double f(double x)
{
double y;
y=sin(x);
y=y/x;
return y;
}
void main()
{
double a,b,r,h,z,n;
int k,j;
double p[50][50];
printf("Please input'a=?,b=?,r=?':\n");
scanf("a=%f,b=%f,r=%f",&a,&b,&r);
h=b-a;
p[0][0]=h*(f(a)+f(b))/2;
for(k=1;;k++)
{
z=0;
for(j=1;j
帮忙看看这段程序哪错了,非常感激!#include #include double f(double x) { double y;#include#includedouble f(double x){double y;y=sin(x);y=y/x;return y;}void main(){double a,b,r,h,z,n;int k,j;double p[50][50];printf("Please input'a=?,b=?,r
double k,j,a,b,r,h,z,n;
改成
double a,b,r,h,z,n;
int k,j;
因为数组下标要是整数
同时注意
输入时:scanf("a=%f,b=%f,r=%f",&a,&b,&r);