新知识点:输出%要打%%,不然没有
C++ 代码
#include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
int x[6] = {0, 15, 12, 10, 7, 4};
double a;
cin >> a;
int i;
if(a <= 400) i = 1;
else if(a <= 800) i = 2;
else if(a <= 1200) i = 3;
else if(a <= 2000) i = 4;
else i = 5;
printf("Novo salario: %.2f\n",a*(1+x[i]/100.0));
printf("Reajuste ganho: %.2f\n",a*x[i]/100);
printf("Em percentual: %d %%",x[i]);
return 0;
}