AcWing 661. 平均数3
原题链接
简单
作者:
枫哥
,
2024-10-22 22:01:32
,
所有人可见
,
阅读 2
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
float n1,n2,n3,n4,media,Y;
cin >> n1 >> n2 >> n3 >> n4;
media = (n1*2 + n2*3 + n3*4 + n4*1)/10.0;
cout << fixed << setprecision(1) << "Media: " << media << endl;
if (media >= 7.0) cout << "Aluno aprovado." << endl;
else if(media < 5.0) cout << "Aluno reprovado." << endl;
else {
cout << "Aluno em exame." << endl;
cin >> Y;
cout << "Nota do exame: " << Y << endl;
media = (media + Y) / 2.0;
if (media >= 5.0 ) cout << "Aluno aprovado." << endl;
else cout << "Aluno reprovado." <<endl;
cout << "Media final: " << media;
}
return 0;
}