diff --git a/未命名1.cpp b/未命名1.cpp new file mode 100644 index 0000000..ba59e7d --- /dev/null +++ b/未命名1.cpp @@ -0,0 +1,323 @@ +#include +#include +#include +#include +#define N 2 +struct student +{ + char name[10]; + char no[100]; + int sex; + int age; + char bnote[100]; +}; +void print(bool menu)//ӡϢ +{ + if (!menu) + { + printf(" \t \t \t (ӭʹñ༶ϵͳ)\t\t\t\t\n"); +printf("********* ӭǵϵͳ *********\n\n"); +printf(":1,Ů:2\n"); + printf("ѧϢ¼ ,press 1\n"); +} + else +{ +printf("ѧϢʾ ,press 2\n"); +printf("ѧϢ ,press 3\n"); +printf("ѧϢɾ ,press 4\n"); +printf("ѧϢ޸ ,press 5\n"); +printf("ѧϢѯ ,press 6\n"); +} +printf("˳ѧϢϵͳ ,press 7\n"); +} +bool Check(char pas[6])//֤ +{ + FILE *fp; + char ch; + char a[7]={" "}; + int i = 0; + if ((fp=fopen("D:\\1.txt","r"))==NULL) + { + printf("ļʧ!\n"); + exit(0); + } + ch=fgetc(fp); + while (ch!=EOF&&i<6) + { + a[i] = ch; + ch=fgetc(fp); + i++; + } + a[6] = '\0'; + if (!strcmp(pas,a)) +{ + return true; + } + else + { + printf("\n"); + return false; + } + fclose(fp); +} +void GetInfo(struct student *arr,int n)//ѧϢ¼ +{ + FILE *fp; + fp=fopen("D:\\student.txt","w"); + for (int i = 0;i