#include#include #include #include #define ll long long int main() { char file_name[200]="C:\Users\165226\Desktop\cs.txt"; FILE * fp=fopen (file_name, "w") ; //打开文件 int c; //c:接收fgetc的返回值,定义为int,而非char M if(NULL==fp) { printf ("Failed tO open the file !n"); return 0; } char str[5]; for(int i=1;i<=10000000;i++) { str[0]=(rand()%26+'a'); str[1]=','; int p=rand()%100; if(p>9) { str[2]=p/10+'0'; str[3]=p%10+'0'; } else { str[2]=p+'0'; } int len=strlen(str); fwrite(str,len,1,fp); fputc(10,fp); // printf("%s====%d---%dn",str,i,strlen(str)); } fclose(fp); }



