c++大作业学生信息管理系统源代码(4)
时间:2025-03-10
时间:2025-03-10
c++大作业学生信息管理系统源代码
char a[30];
int b=1;
cout<<"请输入您要【修改】的学生的学号或姓名: ";
cin>>a;
while (head)
{
if ((strcmp(head->num,a)==0)||(strcmp(head->name,a)==0))
{
cout<<""<<endl;
b=0;
cout<<"此学生原来的学生成绩信息是:"<<endl;
cout<<"学号 姓名 班级 语文 数学 英语"<<endl;
cout<<head->num<<" "<<head->name<<'\t'<<head->clas<<'\t'<<" "
<<head->chinese<<'\t'<<head->maths<<'\t'<<head->english<<endl;
cout<<"请输入修改后的学生成绩信息:"<<endl;
cout<<"学号 姓名 班级 语文 数学 英语"<<endl;
cin>>head->num>>head->name>>head->clas>>head->chinese>>head->maths>>head->english;
head->total=head->chinese+head->maths+head->english; head->average=float(head->total)/3;
}
head=head->next;
}
if (b==1) cout<<"无此学号或姓名的成绩记录!"<<endl;
}
//◆5(1)
void geren(student *head) //查询个人成绩功能
{
char a[30];
int b=1;
cout<<"请输入您要【查询】的学生的学号或姓名: ";
cin>>a;
cout<<"此学生的学生成绩信息是:"<<endl;
cout<<"学号 姓名 班级 语文 数学 英语 总分 均分"<<endl;
while (head)
{
if ((strcmp(head->num,a)==0)||(strcmp(head->name,a)==0))
{
b=0;
cout<<head->num<<" "<<head->name<<'\t'<<head->clas<<'\t'<<" "<<head->chinese<<'\t'
}
head=head->next; <<head->maths<<'\t'<<head->english<<'\t'<<head->total<<'\t'<<setprecision(3)<<head->average<<endl;
上一篇:李君如谈建设学习型党组织