commit d0722894d3ead84f40254d848e2cfe3eba616bc0 Author: xsh20000501 <18408000530@stu.hut.edu.cn> Date: Thu Jan 10 16:49:29 2019 +0800 first commit diff --git a/职工工资管理系统.cpp b/职工工资管理系统.cpp new file mode 100644 index 0000000..68acf8f --- /dev/null +++ b/职工工资管理系统.cpp @@ -0,0 +1,341 @@ +#include +#include +#include +struct worker +{ + char name[30]; + char id[10]; + int salary1,salary2,salary3; +}; +int read(struct worker wo[]); //ȡ +int show(); //˵ +int baocun(struct worker wo[]); // +int add(); // +int see(); //鿴 +int search(); // +int ghcz(); // +int xmcz(); // +int del(); // ɾ +int xmsc(); //ɾ +int ghsc(); //ɾ +int salary(); //нˮͳ +int modify(); //޸ +int ghxg(); //޸ +int xmxg(); //޸ +int back(); + +struct worker wo[100]; //ְϢ +int number=0; //¼ְܵ +int main() +{ + int choose=0; + while(true) + { + show(); + printf("\t\t===>ѡ"); + scanf("%d",&choose); + system("cls"); // + switch(choose) + { + case 0: exit(0);back(); break; //˳ + case 1: add();back(); break; //ְϢ + case 2: see();back(); break; //鿴ְϢ + case 3: search();back(); break; //ְϢ + case 4: del();back(); break; //ɾְϢ + case 5: salary();back(); break; //ְнˮ + case 6: modify();back(); break; //޸ְϢ + default: break; + } + fflush(stdin); //뻺 + getchar(); + system("cls"); + } +} + +int read(struct worker wo[]) +{ + FILE *fp=NULL; + int i=0; + fp=fopen("C:worker.dat","rb"); + while(fread(&wo[i],sizeof(struct worker),1,fp)) + i++; + fclose(fp); + return i; +} + +int show() +{ + printf("\n"); + printf("\t****************ְʹϵͳ****************\n"); + printf("\t################################################\n"); + printf("\t^^^^^^^^^^^^^^^^[1] ְϢ^^^^^^^^^^^^^^^^\n"); + printf("\t^^^^^^^^^^^^^^^^[2] 鿴ְϢ^^^^^^^^^^^^^^^^\n"); + printf("\t^^^^^^^^^^^^^^^^[3] ְϢ^^^^^^^^^^^^^^^^\n"); + printf("\t^^^^^^^^^^^^^^^^[4] ɾְϢ^^^^^^^^^^^^^^^^\n"); + printf("\t^^^^^^^^^^^^^^^^[5] ͳְ^^^^^^^^^^^^^^^^\n"); + printf("\t^^^^^^^^^^^^^^^^[6] ޸ְϢ^^^^^^^^^^^^^^^^\n"); + printf("\t^^^^^^^^^^^^^^^^[7] ˳ ϵͳ^^^^^^^^^^^^^^^^\n"); + printf("\t################################################\n"); +} + +int baocun(struct worker *wo) +{ + FILE *fp=NULL; + fp=fopen("C:worker.dat","ab+"); + fwrite(wo,sizeof(struct worker),1,fp); + fclose(fp); +} + +int add() //ְϢ +{ + int num=0,i=0; + struct worker temp; + printf("Ҫӵְ"); + scanf("%d",&num); + for(i=0;i޸ijɹ\n"); +} + +int ghxg() //չ޸ +{ + FILE *fp=NULL; + char id[10]; + int i=0; + printf("Ҫ޸ĵְĹţ"); + scanf("%s",id); + for(i=0;i޸ijɹ\n"); +} + +int back() +{ + printf("\tEnter˵\n"); +} + + + + + + + + + diff --git a/职工工资管理系统.exe b/职工工资管理系统.exe new file mode 100644 index 0000000..70a7963 Binary files /dev/null and b/职工工资管理系统.exe differ