求助
zkm11 2003-10-09 11:55:49 #define x 2
#include "stdio.h"
main()
{
FILE *p;
int i,m;
long int s=0;
if ((p=fopen("file2.txt","w"))==NULL)
{printf("this file can not open\n");
exit(0);}
i=0;
m=x;
while (s<=10000)
/************************************/
/***********************************/
printf("s=%ld,i=%d\n",s,i);
fprintf(p,"s=%ld,i=%d\n",s,i);
fclose(p);
}
n i
已知 x=2, S=∑ X
i=1
编一程序,求S的值,直到S大于10000为止,并求出n的值,同时将结果送入文件
file2.txt中
注意:部分源程序已给出,请勿改动已给出的源程序,仅在/******与******/之间填入你编写的若干语句