没有合适的资源?快使用搜索试试~ 我知道了~
学生信息管理系统源代码.pdf
资源推荐
资源详情
资源评论
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/release/download_crawler_static/87568091/bg1.jpg)
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct
{
long class_1; //班级
long number; //学号
char name[20]; //姓名
float math; //数学
float c_program; //C 语言
float physics; //大学物理
float english; //大学英语
float polity; //政治
float sport; //体育
float summary; //总分
float average; //平均分
}Student;
Student stud[100]; //定义结构体数组变量的大小
int i=0; //i 用于记录输入的学生的个数
int menu() //菜单函数
{
int a;
printf("***********************学生信息管理系统*************************");
//菜单选择
printf(" 【1】输入学生信息");
printf(" 【2】显示所有学生的信息");
printf(" 【3】按平均分升降排序");
printf(" 【4】根据学生的学号查找学生的信息");
printf(" 【5】插入学生的信息");
printf(" 【6】删除学生的信息");
printf(" 【7】修改学生的信息");
printf(" 【8】从文件中读入数据");
printf(" 【9】将所有记录写入文件");
printf(" 【0】退出本系统");
printf("***********************学生信息管理系统*************************");
printf("请选择你要的操作【0-9】:");
scanf("%d",&a); //读入一个数
while(a<0 || a>9)
{
printf("输入错误!请重新输入。");
scanf("%d",&a); //输入错误就一直循环!^_^
}
![](https://csdnimg.cn/release/download_crawler_static/87568091/bg2.jpg)
system("cls"); //清屏
return(a); //返回 a 的值
}
int input(Student stud[]) //输入学生信息
{
char flag='Y';
while(flag=='y' || flag=='Y') //判断
{
printf("请输入该学生的班别:"); //交互输入学生信息
scanf("%ld",&stud[i].class_1);
printf("请输入该学生的学号:");
scanf("%ld",&stud[i].number);
printf("请输入该学生的姓名:");
scanf("%s",&stud[i].name);
printf("请输入该学生的“数学”分数:");
scanf("%f",&stud[i].math);
printf("请输入该学生的“C 程序设计语言”分数:");
scanf("%f",&stud[i].c_program);
printf("请输入该学生的“大学物理”分数:");
scanf("%f",&stud[i].physics);
printf("请输入该学生的“大学英语”分数:");
scanf("%f",&stud[i].english);
printf("请输入该学生的“体育”分数:");
scanf("%f",&stud[i].sport);
printf("请输入该学生的“政治”分数:");
scanf("%f",&stud[i].polity);
getchar(); //用于消除回车键
stud[i].summary=stud[i].math+stud[i].c_program+stud[i]. physics
+stud[i].english+stud[i].sport+stud[i].polity;
stud[i].average=stud[i].summary/6;
printf("该学生的总分为:%6.2f\t 平均分为:%6.2f\n",stud[i].summary,stud[i].average);
i++;
printf("继续输入学生信息请按:Y or y,退出请按:N or n.\n");
scanf("%c",&flag); //判断是否继续输入
}
printf("按任意键回主菜单\n");
getchar();
system("cls");
return(i);
}
![](https://csdnimg.cn/release/download_crawler_static/87568091/bg3.jpg)
void Display(Student stud[],int n) //显示所有记录
{
int k;
if(n==0)
printf("暂无学生记录!\n");
else
{
printf(" 班别 学号 姓名 数学 C 语言 物理 英语 体育 政
治 总分 平均分\n");
for(k=0;k<n;k++) //循环输出
{
printf("%7ld",stud[k].class_1);
printf("%7ld",stud[k].number);
printf("%9s",stud[k].name);
printf("%7.2f",stud[k].math);
printf("%7.2f",stud[k].c_program);
printf("%7.2f",stud[k].physics);
printf("%7.2f",stud[k].english);
printf("%7.2f",stud[k].sport);
printf("%7.2f",stud[k].polity);
printf("%7.2f",stud[k].summary);
printf("%8.2f\n",stud[k].average);
}
}
system("pause");
system("cls");
}
void Sort(Student stud[],int i) //按平均分排序
{
int m,n,k; //m,n 为循环变量
Student t;
for(m=0;m<i-1;m++) //排序
for(n=m+1;n<i;n++)
if(stud[m].average<stud[n].average)
{
t=stud[m];
stud[m]=stud[n];
stud[n]=t;
}
printf("排序后的顺序为:\n");
剩余10页未读,继续阅读
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/249eab16de6546ffac983dad0493a580_weixin_42917728.jpg!1)
cyctlove
- 粉丝: 1
- 资源: 41
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)