AcWing 661. 平均数3
原题链接
简单
作者:
深街酒徒
,
2024-11-18 20:55:23
,
所有人可见
,
阅读 1
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
double a, b, c,d;
cin >> a >> b >> c >> d;
double x = (2 * a + 3 * b + 4 * c + d) / 10.0;
printf("Media: %.1f\n", x);
if (x >= 7) cout << "Aluno aprovado." << endl;
else if (x < 5) cout << "Aluno reprovado." << endl;
else
{
cout << "Aluno em exame." << endl;
double y;
cin >> y;
cout << "Nota do exame: " << y << endl;
double z = (x + y) / 2;
if (z >= 5) cout << "Aluno aprovado." << endl;
else cout << "Aluno reprovado." << endl;
printf("Media final: %.1f", z);
}
return 0;
}