From a180d53d592cb3d86dafc1015162e1f42a873b2d Mon Sep 17 00:00:00 2001 From: Acesxmm <1401419647@qq.com> Date: Sun, 13 Jan 2019 20:55:59 +0800 Subject: [PATCH] first commit --- 学生籍贯信息记录簿源代码.cpp | 139 +++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 学生籍贯信息记录簿源代码.cpp diff --git a/学生籍贯信息记录簿源代码.cpp b/学生籍贯信息记录簿源代码.cpp new file mode 100644 index 0000000..d5721c6 --- /dev/null +++ b/学生籍贯信息记录簿源代码.cpp @@ -0,0 +1,139 @@ +#include +#include +#include +typedef struct student +{ +char name[10]; +int num; +char sex[10]; + int age; +char location[10]; +}s; +void Fun() +{ +char chl; +printf("\n\t--Y/N˳ϵͳ[ִСд]\n"); + scanf("%s",&chl); + switch(chl) + { + case'Y': + case'y': + break; + case'N': + case'n': + printf("ӭٴʹá\n"); + exit(0); + default: + printf(""); + +} +} +void menu() +{ +printf("**********ӭѧϢ¼**********\n"); +printf("1--ʾϢ\n"); +printf("2--ѧŲѯ\n"); +printf("3--ѯ\n"); +printf("4--ѯ\n"); +printf("5--ѧϢ\n"); +printf("6--\n"); +printf("**********ѡеѡ**********\n"); +} +main() +{ +system("cls"); +system("color FC"); +FILE*fp; +s stu[100]; +int i=0,n=0,m,num; +char name[10],location[20]; +fp=fopen("information.txt","r+"); +while(!feof(fp)) +{ +fscanf(fp,"%s%d%s%d%s",&stu[i].name,&stu[i].num,&stu[i].sex,&stu[i].age,&stu[i].location); +i++; +n++; +} +L: menu(); +printf("ţ"); +scanf("%d",&m); +system("cls"); +switch(m) +{ +case 1: +for(i=0;i