#include#include #include #include #define N 100 struct employee //职工基本信息 { long num; //工号 int position; //职位:1为董事长,2为总经理,3为副总经理 4.普通员工 char name[8]; //姓名 char sex[2]; //性别;f为女,m为男 int age; //年龄 int cult; //文化程度:1为硕士。2为学士。3为其他 int state; //健康状况:1为好,2为一般。3为差 }e[N]; void input () { int i,j; printf ("请确认输入信息的职工人数(最多100人)n"); scanf ("%d",&i); if (i<1 || i>100) { printf ("输入数据有误,请重新输入n"); scanf ("%d",&i); } FILE *fp; if ((fp=fopen("d:\Staff information.txt","w"))==NULL) { printf ("Can not open file!"); exit (0); } printf ("*****************************************************************n"); printf ("备注:n职位:1为董事长,2为总经理,3为副总经理 4.普通员工n性别;f为女,m为男n文化程度:1为硕士。2为学士。3为其他n健康状况:1为好,2为一般。3为差n"); printf ("*****************************************************************n"); printf ("请输入%d名职工信息,(工号、职位等信息,请按Tab键隔开)n",i); printf ("工号t职位t姓名t性别t年龄t文化程度t健康状况n"); for (j=0;j 我只是个萌新,代码有什么问题,我也不知道为啥啊。
转自··· (⊙﹏⊙)额···我忘了作者是谁了···



