AcWing 669. 加薪(很简单 细心就好)
原题链接
简单
作者:
noobcoder
,
2020-03-01 18:27:27
,
所有人可见
,
阅读 1170
#include <iostream>
using namespace std;
int main(){
double a,sum,res,b;
int c;
cin>>a;
if(a>=0&&a<=400.00)
{ b = a*0.15;
sum = a+b;
c = 15;
}
else if (a>400.00&&a<=800.00){
b = a*0.12;
sum = a+b;
c=12;
}
else if (a>800.00&&a<=1200.00){
b=a*0.1;
sum = a+ b;
c = 10;
}
else if (a>1200.00&&a<=2000.00){
b = a*0.07;
sum = a+b;
c = 7;
}
else {
b = a*0.04;
sum = a + b;
c = 4;
}
printf("Novo salario: %.2lf\n",sum);
printf("Reajuste ganho: %.2lf\n",b);
printf("Em percentual: %d %%",c);
return 0;
}