From a9cf74e4f134b893b653bd626660a3d5128c1b96 Mon Sep 17 00:00:00 2001 From: p6xmqsebw <3364724213@qq.com> Date: Wed, 29 May 2024 12:05:16 +0800 Subject: [PATCH] Update main.c --- src/main.c | 203 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 200 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 4d86da1..d3403f0 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,203 @@ #include -int main() -{ - return 0; +#include +#include +#define N 99 +static int run; +static int num; +struct Date{ + int year; + int month; + int day; +}; +struct Student{ + int ID; + char name[20]; + char sex[1]; + int age; + char major[20]; + struct Date birthday; +}; +static struct Student student[N]; +void menu(){ + printf("\n\n"); + printf("*****************************************************\n"); + printf("*-----------------数据结构第十一组-------------------\n"); + printf("* 学生信息管理系统 *\n"); + printf("*****************************************************\n"); + printf("********************系统功能菜单*********************\n"); + printf("---------------------- --------------------------\n"); + printf("*****************************************************\n"); + printf("** 1、增加学生信息 2、查询学生信息 **\n"); + printf("*****************************************************\n"); + printf("** 3、删除学生信息 4、列出所有学生信息 **\n"); + printf("*****************************************************\n"); + printf("** 5、退出系统 **\n"); + printf("*****************************************************\n"); + printf("---------------------- --------------------------\n"); +} +void addSTudent(){ //增加学生信息 + int i = 0; + while(1){ + if(student[i].ID == 0&&i!=N){//找一个空位置存放该学生信息 + scanf: + printf("请输入学生学号:"); + scanf("%d",&student[i].ID); + for(int j=0;j