diff --git a/职工工资管理系统.c b/职工工资管理系统.c index 7ee9e3d..38d3a18 100644 --- a/职工工资管理系统.c +++ b/职工工资管理系统.c @@ -25,6 +25,7 @@ struct emploee //ְ }emp[NUM],newemp; int main() { + system("color CF"); menu(); } void menu()// @@ -40,6 +41,7 @@ do{ printf("* 6-----ְϢ------ *\n"); printf("* 7-----ְϢ------ *\n"); printf("* 8-------˳-------- *\n"); + printf("* :ŷ *\n"); printf("*********************************************\n"); printf("ѡ1-8:"); scanf("%d",&n); @@ -77,7 +79,7 @@ switch(n) { fread(&emp[i],sizeof(struct emploee),1,fp); i++; - }while(feof(fp)==0);//ϵļ + }while(feof(fp)==0);//ļ } fclose(fp); return(i-1);// @@ -151,13 +153,13 @@ void count() } for(n=0;fread(&emp[n],sizeof(struct emploee),1,fp)!=0;n++) { - if(emp[n].wage4>=2000&&emp[n].wage4<3000) + if(emp[n].wage4>=2000&&emp[n].wage4<=3000) b++; else if(emp[n].wage4>0&&emp[n].wage4<=2000) c++; } a=n-b-c; - printf("ǰ֮1000~2000Ԫռİٷ֮%.1f\n",c*100/n); + printf("ǰ֮0~2000Ԫռİٷ֮%.1f\n",c*100/n); printf("ǰ֮2000~3000Ԫռİٷ֮%.1f\n",b*100/n); printf("ǰ֮3000Ԫռİٷ֮%.1f\n",a*100/n); fclose(fp); @@ -234,16 +236,16 @@ void modi_num() printf("\tû%sְŵְ\n",num); return; } - printf("ID ְ ҽƱ ܹ\n"); - printf(" %-6s %-6s %-8d %-8d %-8d %-8d %-8d %-8d\n",emp[i].no,emp[i].name,emp[i].wage1,emp[i].wage2,emp[i].jt,emp[i].ylbx,emp[i].funds,emp[i].wage3); - printf("ID ְ ҽƱ \n"); + printf("ID ְ ҽƱ ܹ\n"); + printf("%-6s %-6s %-8d %-8d %-8d %-8d %-8d %-8d\n",emp[i].no,emp[i].name,emp[i].wage1,emp[i].wage2,emp[i].jt,emp[i].ylbx,emp[i].funds,emp[i].wage3); + printf("ID ְ ҽƱ ܹ\n"); scanf("%s%s%d%d%d%d%d",newemp.no,newemp.name,&newemp.wage1,&newemp.wage2,&newemp.jt,&newemp.ylbx,&newemp.funds);//ȡµְ¼ newemp.wage3=newemp.wage1+newemp.wage2+newemp.jt-newemp.ylbx-newemp.funds; fseek(fp,-(long)sizeof(struct emploee),SEEK_CUR); //ļָָ޸ĵļ¼ͷ fwrite(&newemp,sizeof(struct emploee),1,fp); //newempǵǰ¼ printf(" ޸ĺ:\n"); fseek(fp,0,SEEK_SET); //ʾ޸ĺļ - printf("ID ְ ҽƱ ܹ\n"); + printf("ID ְ ҽƱ ܹ\n"); for(i=0;fread(&emp[i],sizeof(struct emploee),1,fp)!=0;i++) printf(" %-6s %-6s %-8d %-8d %-8d %-8d %-8d %-8d\n",emp[i].no,emp[i].name,emp[i].wage1,emp[i].wage2,emp[i].jt,emp[i].ylbx,emp[i].funds,emp[i].wage3); fclose(fp); @@ -268,8 +270,8 @@ void search_num() printf("\t޴\n"); return; } - printf("ID ְ ҽƱ ܹ\n"); - printf(" %-6s %-6s %-8d %-8d %-8d %-8d %-8d %-8d\n",emp[i].no,emp[i].name,emp[i].wage1,emp[i].wage2,emp[i].jt,emp[i].ylbx,emp[i].funds,emp[i].wage3); + printf("ID ְ ҽƱ ܹ\n"); + printf("%-6s %-6s %-8d %-8d %-8d %-8d %-8d %-8d\n",emp[i].no,emp[i].name,emp[i].wage1,emp[i].wage2,emp[i].jt,emp[i].ylbx,emp[i].funds,emp[i].wage3); printf("밴1밴0\n"); scanf("%d",&n); switch(n) @@ -316,7 +318,7 @@ void add() scanf("%s",emp[i].no); printf(":"); scanf("%s",&emp[i].name); - printf(":"); + printf(":"); scanf("%d",&emp[i].wage1); printf("ְ:"); scanf("%d",&emp[i].wage2); diff --git a/职工工资管理系统.exe b/职工工资管理系统.exe index a524309..0f9ce85 100644 Binary files a/职工工资管理系统.exe and b/职工工资管理系统.exe differ