#include
#include
#include
#define N 4000
int main(void)
{
FILE *fp;
srand( (unsigned)time( NULL ) );
int i,j;
long double data[]={0};
long double sum=0;
fp=fopen("sample.txt","w");
for(i=0;i
for(j=0;j<12;j++)
{
sum=sum+(rand()/(RAND_MAX+1.0));
}
data[i]=sum-6.0;
sum=0;
}
fputc('\n',fp);
for(i=0;i
fprintf(fp,"%10lf",data[i]);
}
fclose(fp);
}
编译都通过的,但调试运行程序时却停止工作。请各位高手看看,谢谢了!