2个回答
展开全部
#include<iostream.h>
int main()
{
char name;
int id;
char sex;float a1,a2,a3,a4,a5,average;
char xi;
cout<<"请依次输入学生的姓名,学号,性别,系院"<<endl;
cin>>name>>id>>sex>>xi;
cout<<"请输入5门成绩"<<endl;
cin>>a1>>a2>>a3>>a4>>a5;
average=(a1+a2+a3+a4+a5)/5.0;
cout<<"平均成绩是:"<<average<<endl;
return 0;
}
int main()
{
char name;
int id;
char sex;float a1,a2,a3,a4,a5,average;
char xi;
cout<<"请依次输入学生的姓名,学号,性别,系院"<<endl;
cin>>name>>id>>sex>>xi;
cout<<"请输入5门成绩"<<endl;
cin>>a1>>a2>>a3>>a4>>a5;
average=(a1+a2+a3+a4+a5)/5.0;
cout<<"平均成绩是:"<<average<<endl;
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询