题目描述
样例
#include<iostream>
#include<iomanip>
using namespace std;
int main() {
double x;
double y = 0;
double z = 0;
cin >> x;
if (x <= 400) {
y = 0.15;
z = x * y;
}
else if (x <= 800 && x > 400) {
y = 0.12;
z = x * y;
}
else if (x <= 1200 && x > 800) {
y = 0.1;
z = x * y;
}
else if (x <= 2000 && x > 1200) {
y = 0.07;
z = x * y;
}
else if (x > 2000) {
y = 0.04;
z = x * y;
}
cout << fixed << setprecision(2)<< "Novo salario: " << z + x << endl;
cout << fixed << setprecision(2)<<"Reajuste ganho: " << z << endl;
cout << fixed << setprecision(0)<< "Em percentual: " << y * 100 << " %" << endl;
return 0;
}
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla