楼主的意思是输出你的结果把?
看我写的
==================================================================
#include
#include
int
main()
{
double
x,
a0,a1,f,fd;
x=1.0;
file
*fp;//建立一个文件操作指针
fp=fopen("1.txt","w+");//以追加的方式建立或打开1.txt,默认位置在你程序的目录下面
do
{a0=x;
f=((a0-18)*a0+95)*a0-150;
fd=(3*a0-36)*a0+95;
x=a0-f/fd;
}
while(x-a0>=1.e-5);
printf("\nx=%.6f",x);
fprintf(fp,"\nx=%.6f",x);//同输出printf一样,以格式方式输出到文本中
fclose(fp);//关闭流
}
温馨提示:答案为网友推荐,仅供参考