📄 prog1.c
字号:
#include <conio.h>
#include <math.h>
#include <stdio.h>
float countValue()
{
float x0,x1=0.0;
while(1)
{
x0=x1;
x1=cos(x0);
if(fabs(x0-x1)<1e-6) break;
}
return x1;
}
main()
{
clrscr();
printf("实根=%f\n", countValue());
printf(" %f\n",cos(countValue())-countValue());
writeDAT();
}
writeDAT()
{
FILE *wf ;
wf=fopen("out.dat","w") ;
fprintf(wf, "%f\n", countValue()) ;
fclose(wf) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -