|
< >程序及报错如下,敬请高手指教:</P>
< >#include <ansi_c.h>
#include <math.h>
#define max 1000
zero(a,b)
double a, b;
{ 此处为错误1
int times=0;
double x;
do
{
x=(a+b)/2;
if((sin(x)*sin(a))>0)
a=x;
else
b=x;
if(times++>max)
{
printf("too many times!\n");
return ;
}
}while(fabs(a-b)>1E-6);
if((sin(a)*sin(b))<0)
printf("zero=%1f\n",x);
else
printf("There is no zero point!");
return;
}
main( )
{
double m, n;
printf("Input Datanumber: m=? n=?\n");
scanf("%1f%1f", &m, &n);
zero(m,n); 此处为错误2
}
a.c - 2 errors
7, 3 Missing prototype.
37, 8 Missing prototype.
</P> |
|