题目描述
这题一定要认真看题,信息很多,稍不注意就会出错,把每一步都看清楚。
样例
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
double n1,n2,n3,n4,x,y,z;
cin>>n1>>n2>>n3>>n4;
x=(2.0*n1+3.0*n2+4.0*n3+1.0*n4)/10.0;
cout<<fixed<<setprecision(1)<<"Media: "<<x<<endl;
if(x>=7.0)
cout<<"Aluno aprovado."<<endl;
else if(x<5.0)
cout<<"Aluno reprovado."<<endl;
else if(x<7.0&&x>=5.0)
{
cout<<"Aluno em exame."<<endl;
cin>>y;
cout<<fixed<<setprecision(1)<<"Nota do exame: "<<y<<endl;
z=(x+y)/2;
if(z>=5.0)
cout<<"Aluno aprovado."<<endl;
else
cout<<"Aluno reprovado."<<endl;
cout<<fixed<<setprecision(1)<<"Media final: "<<z<<endl;
}
return 0;
}