From 045a4302746b76ca9fb6338db7e8eab28fa9f1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E7=91=9E=E6=B3=A2?= <2930720494@qq.com> Date: Fri, 11 Jan 2019 19:24:21 +0800 Subject: [PATCH] first commit --- 未命名1.cpp | 323 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 323 insertions(+) create mode 100644 未命名1.cpp 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