diff --git a/学籍系统2.cpp b/学籍系统2.cpp new file mode 100644 index 0000000..01f416c --- /dev/null +++ b/学籍系统2.cpp @@ -0,0 +1,221 @@ +#include +#include +#include +#include +int n=0,i; +struct address_book +{ + char name[20]; + int num; + int age; + char place[80]; + char sex; + char clas[40]; + char department[40]; + char domain[40]; + char dowhat[20]; +}stud[200]; +void add() +{ + char j; +front1: + system("cls");// + printf("\nҪӵ"); + scanf("%s",stud[n].name); + printf("\nҪӵѧţ8λ"); + scanf("%d",&stud[n].num); + printf("\nҪӵԱF/M"); + scanf("\n%c",&stud[n].sex); + printf("\nҪӵ䣺"); + scanf("%d",&stud[n].age); + printf("\nҪӵİ༶"); + scanf("%s",stud[n].clas); + printf("\nҪӵļ᣺"); + scanf("%s",stud[n].place); + printf("\nҪӵϵ"); + scanf("%s",stud[n].department); + printf("\nҪӵרҵ"); + scanf("%s",stud[n].domain); + printf("\nѧ仯"); + scanf("%s",stud[n].dowhat); + getchar(); + n++; + printf("ǷY/N?"); + j=getchar(); + getchar(); + if(j=='y'||j=='Y') goto front1;//ٴ¼ +} +void del() +{ + int k=0,m,i; + char j; +front2: + system("cls");// + printf("\nҪɾѧţ"); + scanf("%d",&m); + getchar(); + for(i=0;istud[i+1].num) + { + t=stud[i]; + stud[i]=stud[i+1]; + stud[i+1]=t; + } + for(i=0;i<=n-1;i++) + if(stud[i].num!=0) + printf("%-8d %-10s %-10s\n",stud[i].num,stud[i].domain,stud[i].place); + printf("سأ"); + getchar(); + getchar(); +} +void change() +{ + int k=0,m; + char j; +front5: + system("cls");// + printf("\nҪ޸ļ¼ѧţ"); + scanf("%d",&m); + getchar(); + for(i=0;i