AcWing 669. 加薪
原题链接
简单
作者:
开始下雨了
,
2024-07-26 14:00:58
,
所有人可见
,
阅读 1
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
double a;
int percentual;
double newPrice,price;
cin>>a;
if(a>=0&&a<=400){
price=a*0.15;
newPrice=price+a;
percentual=15;
}else if(a>400&&a<=800){
price=a*0.12;
newPrice=price+a;
percentual=12;
}else if(a>800&&a<=1200){
price=a*0.1;
newPrice=price+a;
percentual=10;
}else if(a>1200&&a<=2000){
price=a*0.07;
newPrice=price+a;
percentual=7;
}else{
price=a*0.04;
newPrice=price+a;
percentual=4;
}
printf("Novo salario: %.2lf\n",newPrice);
printf("Reajuste ganho: %.2lf\n",price);
printf("Em percentual: %d %\n",percentual);
return 0;
}