0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00
Baoshuo Ren 2021-08-02 11:02:36 +08:00 committed by Baoshuo Ren
parent 33bdf7d748
commit 6b4e3e28cf
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

27
AcWing/661/661.cpp Normal file
View File

@ -0,0 +1,27 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, d, x, y, z;
cin >> a >> b >> c >> d;
x = (2.00 * a + 3.00 * b + 4.00 * c + 1.00 * d) / 10.00;
printf("Media: %.1lf\n", x + 0.01);
if (x >= 7.0)
cout << "Aluno aprovado." << endl;
else if (x < 5.0)
cout << "Aluno reprovado." << endl;
else {
cout << "Aluno em exame." << endl;
cin >> y;
printf("Nota do exame: %.1lf\n", y + 0.01);
z = (x + y) / 2;
if (z >= 5.0)
cout << "Aluno aprovado." << endl;
else
cout << "Aluno reprovado." << endl;
cerr << z << endl;
printf("Media final: %.1lf\n", z);
}
return 0;
}