AcWing 669. 加薪
原题链接
简单
作者:
SayYong
,
2024-09-27 22:45:34
,
所有人可见
,
阅读 1
#include <iostream>
using namespace std;
int main(void)
{
double wage, wage_new;
cin >> wage;
if (wage >= 0 && wage <= 400) {
wage_new = wage * 1.15;
} else if (wage >= 400.01 && wage <= 800) {
wage_new = wage * 1.12;
} else if (wage >= 800.01 && wage <= 1200) {
wage_new = wage * 1.10;
} else if (wage >= 1200.01 && wage <= 2000) {
wage_new = wage * 1.07;
} else if (wage > 2000) {
wage_new = wage * 1.04;
}
printf("Novo salario: %.2f\n", wage_new);
printf("Reajuste ganho: %.2f\n", wage_new - wage);
printf("Em percentual: %.0f %%\n", ((wage_new - wage) / wage * 100));
return 0;
}