AcWing 661. 平均数3
原题链接
简单
作者:
呆jio不
,
2024-11-07 16:32:35
,
所有人可见
,
阅读 1
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
double a,b,c,d,x,y,z;
cin>>a>>b>>c>>d;
x=(2*a+3*b+4*c+d)/10;
cout<<"Media: "<<x<<endl;
if(x>=7) cout<<"Aluno aprovado.";
else if(x<=5) cout<<"Aluno reprovado.";
else{
cout<<"Aluno em exame."<<endl;
cin>>y;
cout<<"Nota do exame: "<<y<<endl;
z=(x+y)/2;
if(z>=5) cout<<"Aluno aprovado."<<endl;
else cout<<"Aluno reprovado."<<endl;
cout<<"Media final: "<<z<<endl;
}
return 0;
}