手建hashmap
循环省键盘
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
float Salary, promotionMap[5] = {0.15, 0.12, 0.10, 0.07, 0.04};
float Criterion[4]= {400, 800, 1200, 2000};
cin >> Salary;
int i, a = -1;
for (int i=0; i< 5; i++){
if (Salary > Criterion[i]) a++;
else a = a;
}
printf("Novo salario: %.2f\n", Salary +Salary*promotionMap[a]);
printf("Reajuste ganho: %.2f\n", Salary*promotionMap[a]);
printf("Em percentual: %.0f ", promotionMap[a]*100);
puts("%");
}