请编写函数countValue(),它的功能是:求n以内(不包括n)同时能被3与7整除的所有自然数之和的平方根s,并作为函数值返回,最后结果s输出到文件OUT11.DAT中。
例如,若n为1000时,函数值应为s=153.909064。
注意:部分源程序已给出。
请勿改动主函数main()和输入输出函数progReadWrite()的内容。
试题程序:
include<conio.h>
include<math.h>
include<stdio.h>
double countValue(int n)
{
}
main ( )
{
clrscr();
printf ("自然数之和的平方根=%f\n", countValue(lO00)) ;
pregReadWrite();
}
pregReadWrite()
{
FILE *wf;
int i, n;
float s;
wf = fepen("OUT11.DAT", "w");
s = ceuntValue(1000);
fprintf(wf, "%f\n", s);
fclese(wf);
}