仍然有一些小bug,后续会发布OC完善版的图书馆管理系统,欢迎批评指正。

 #include <stdio.h>
void menu_choose();
typedef struct
{
int Id;
int age;
char name[];
char sex[]; }Student;
Student stuArr[];
int stuCount=; void readStu(Student * stu)
{
printf("所有学生信息为:\n");
for(int i=;i<stuCount;i++)
{
printf("姓名为:%s 性别为:%s 年龄为:%d 学号为:%d\n", stu[i].name, stu[i].sex, stu[i].age, stu[i].Id);
}
menu_choose();
}
void findStu(Student stu)
{
printf("请输入要查找的学生学号:");
scanf("%d",&stu.Id);
for(int i=;i<stuCount;i++)
{
if(stuArr[i].Id==stu.Id)
{
printf("要查找的学生信息为:");
printf("姓名为:%s 性别为:%s 年龄为:%d 学号为:%d\n",stuArr[i].name,stuArr[i].sex,stuArr[i].age,stuArr[i].Id);
}
if(stuArr[stuCount-].Id!=stu.Id)
{
printf("没有找到该学生\n");
} }
}
void addStu(Student stu)
{ printf("请输入学生姓名:");
scanf("%s",stu.name);
printf("请输入学生性别:");
scanf("%s",stu.sex);
printf("请输入学生年龄:");
scanf("%d",&stu.age);
printf("请输入学生学号:");
scanf("%d",&stu.Id);
stuArr[stuCount]=stu;
stuCount++;
printf("添加成功!\n");
// readStu(stuArr);
menu_choose();
}
void delStu(Student stu)
{
printf("请输入要删除的学生学号:");
scanf("%d",&stu.Id);
for(int i=;i<stuCount;i++)
{
if(stuArr[stuCount-].Id!=stu.Id)
{
printf("该学生不存在\n");
}
if(stuArr[i].Id == stu.Id)
{
stuArr[i]=stuArr[i+];
printf("删除成功!\n");
} }
menu_choose(); }
void updateStu(Student stu)
{
printf("请输入要修改的学生学号:");
scanf("%d",&stu.Id);
for(int i=;i<stuCount;i++)
{
if(stuArr[i].Id==stu.Id)
{
printf("你将学生姓名修改为:");
scanf("%s",stu.name);
printf("你将学生性别修改为:");
scanf("%s",stu.sex);
printf("你将学生年龄修改为:");
scanf("%d",&stu.age);
printf("你将学生学号修改为:");
scanf("%d",&stu.Id);
stuArr[i]=stu;
printf("修改成功\n");
}
if(stuArr[stuCount-].Id!=stu.Id)
{
printf("该学生不存在\n");
}
}
menu_choose();
}
int exitSys()
{
return ;
}
void menu_choose()
{ printf(" 学生管理系统 \n");
printf(" 1.查看所有学生 ");
printf(" 2.增加学生信息\n");
printf(" 3.删除学生信息 ");
printf(" 4.修改学生信息\n");
printf(" 5.查找学生信息 ");
printf(" 6.退出系统 \n");
printf("请输入功能编号:");
int menunum;
scanf("%d",&menunum);
Student stu;
switch (menunum)
{
case :
readStu(stuArr);
break;
case :
addStu(stu);
break;
case :
delStu(stu);
break;
case :
updateStu(stu);
break;
case :
findStu(stu);
break;
case :
exitSys();
default:
break;
}
}
int main(int argc, const char * argv[])
{
menu_choose();
return ;
}

C语言版本学生信息管理系统的更多相关文章

  1. C语言练习-学生信息管理系统

    题目要求: 学生信息管理系统struct studentInfo{ int id; char name[128]; int age; char sex; int c_score; int cpp_sc ...

  2. 【转载】C语言综合实验1—学生信息管理系统

    http://www.cnblogs.com/Anker/archive/2013/05/06/3063436.html 实验题目:学生信息管理系统 实验要求:用户可以选择1-7可以分别进行学生信息的 ...

  3. C语言小练习之学生信息管理系统

    C语言小练习之学生信息管理系统 main.c文件   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2 ...

  4. 大一C语言结课设计之《学生信息管理系统》

    第一次写这么长的程序,代码仅供參考,有问题请留言. /* ** 学生信息管理系统 ** IDE:Dev-Cpp 4.9.9.2 ** 2014-6-15 */ #include <stdio.h ...

  5. 学生信息管理系统(c语言)

    ①注意: 程序中使用了sleep()函数.system()函数 关于 sleep() 函数 sleep() 函数的头文件和用法会因环境的不同而有所不同. 具体见-sleep()函数功能及用法 关于sy ...

  6. 学生信息管理系统(C语言)

    #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct student ...

  7. 基于数组或链表的学生信息管理系统(小学期C语言程序实训)

    1.基于数组的学生信息管理系统 实验内容: 编写并调试程序,实现学校各专业班级学生信息的管理.定义学生信息的结构体类型,包括:学号.姓名.专业.班级.3门成绩. 实验要求: (1) main函数:以菜 ...

  8. 基于Spring MVC + Spring + MyBatis的【学生信息管理系统】

    资源下载:https://download.csdn.net/download/weixin_44893902/45603211 练习点设计: 模糊查询.删除.新增 一.语言和环境 实现语言:JAVA ...

  9. 学生信息管理系统v1.0

    昨天一个教师朋友找到我,告诉我现在学期末他工作比较忙.需要统计处理很多学生信息,想让我帮他做一个管理系统.实现的功能就是把WPS表格转化成Word文档,将每一个学生的信息都能够分开,并且要根据名字找到 ...

随机推荐

  1. ngTemplateOutlet递归的问题

    今天尝试通过 ng-template 加 ngTemplateOutlet实现一个递归的菜单.但是遇到一个问题:NullInjectorError: No provider for NzMenuDir ...

  2. day57——ajax之初体验

    转行学开发,代码100天——2018-05-12 今天是一个特别的日子——首先是母亲节,在此也祝福亲爱的妈妈健康长寿.其次今天是汶川大地震10周年,10年过去了,经历过苦难的人更加坚毅勇敢地面向未来! ...

  3. spring boot配置项profiles active

    结论:通用项配置在applicaton.yml,区别环境配置在application-{profile}.yml中 一直不知道这个参数要不要配,配了有什么用,今天搭一个工程来检验 此项作用:用来区分不 ...

  4. beanstalkd 安装和配置

    安装 安装以centos为例 yum install beanstalkd 配置 使用centos yum安装,通过查看服务脚本发现有这个配置文件 cat /etc/sysconfig/beansta ...

  5. 5 centos 6.10 三节点安装apache hadoop 2.9.1

    Hadoop 版本: apache hadoop 2.9.1JDK 版本: Oracle JDK1.8集群规划master(1): NN, RM, DN, NM, JHSslave1(2): DN, ...

  6. POI读取指定Excel中行与列的数据

    import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import ...

  7. uni-app-小程序中组件不支持id选择器等

    这个问题刚开始遇到的时候有点搞笑啰,正常情况下,id选择器不是最正常的吗?搞锤子哦. 接着我就找度娘了  ,官网给出的解释是:https://developers.weixin.qq.com/mini ...

  8. 【转载】研发应该懂的binlog知识(上)

    ---------------------------------------------------------------------------------------------------- ...

  9. CentOS7 破解登录密码

    1.重启系统,在出现下面这个界面时按e 2.进入之后方向键的下,找到“LANG=en_US.UTF-8",在这个命令后面输入“rd.break",完成之后按ctrl+x进入紧急救援 ...

  10. C++之匿名对象与析构函数的关系

    #include <iostream> using namespace std; class Location{ public: Location(, ){ X = xx; Y = yy; ...