题目描述
blablabla
样例
#include<iostream>
#include<iomanip>
using namespace std;
int main() {
double a, b, c, d, y;
cin >> a >> b >> c >> d >> y;
double x = (a * 2 + b * 3 + c * 4 + d * 1) / 10;
cout << "Media: " << x << endl;
if (x >= 7) {
cout << "Aluno aprovado." << endl;
}
if (x < 5) {
cout << "Aluno reprovado." << endl;
}
if (x >= 5 && x < 7) {
cout << "Aluno em exame." << endl;
cout << "Nota do exame: " << y << endl;
double z = (x + y) / 2;
if (z >= 5) {
cout << "Aluno aprovado." << endl;
}
else cout << "Aluno reprovado." << endl;
cout << "Media final: "<<z << endl;
}
}
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla