1、fprintf(fp1,"%-15s%-15s%-15s%\n",......); // 用"%s %s %s......"比较好。 2、对于新建的文件,应该以"w"方式打开 3、fprintf(fp2,"%d",user_number);//改为fprintf(fp2,"%d ",user_number);更好些