void score_modify(struct STUDENT *Wstu, int *num)
{
int m3, i3;
long long op_3;
char op3_3[20];
float op2_3;
printf(" 1.按学号修改\n 2.按姓名修改\n 0.退出\n");
do
{
printf("请输入你的选择:");
scanf("%d", &m3);
if(m3 == 1)
{
printf("请输入要修改的学生的学号:");
scanf("%l64d", &op_3);
for(i3 = 0; Wstu[i3].stu_ID != op_3 && i3 < *num; i3++);
}
else if(m3 == 2)
{
printf("请输入要修改的学生的姓名:");
scanf("%s", op3_3);
for(i3 = 0; strcmp(Wstu[i3].stu_name, op3_3) != 0 && i3 < *num; i3++);
}
printf("修改前:%l64d %s %.1f\n",Wstu[i3].stu_ID,Wstu[i3].stu_name,Wstu[i3].score);
printf("输入你想修改成绩为:");
scanf("%f",&op2_3);
Wstu[i3].score = op2_3;
printf("\n修改后:%l64d %s %.1f\n\n",Wstu[i3].stu_ID,Wstu[i3].stu_name,Wstu[i3].score);
}while(m3);
printf("修改成功\n");
}
/**************************************/
#ifndef __CHOSE_H__INCLUDE
#define __CHOSE_H__INCLUDE
#define N 100
struct STUDENT
{
long long stu_ID;
char stu_name[20];
float score;
}student[N];
void meun();//菜单
void grade_add(struct STUDENT *Wstu, int *num);//学生成绩新增
void score_inquiry(struct STUDENT *Wstu, int *num);//学生成绩查询
void score_modify(struct STUDENT *Wstu, int *num);//学生成绩修改
void grade_delete(struct STUDENT *Wstu, int *num);//学生成绩删除子函数
void grade_all(struct STUDENT *Wstu, int *num);//学生成绩全览
void grade_statisticsc(struct STUDENT *Wstu, int *num);//班级成绩统计
void yesorno();//退出
#endif