mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
661. 平均数3
https://www.acwing.com/problem/content/submission/code_detail/6835372/
This commit is contained in:
parent
33bdf7d748
commit
6b4e3e28cf
27
AcWing/661/661.cpp
Normal file
27
AcWing/661/661.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user