AcWing 672. 税
原题链接
简单
作者:
SayYong
,
2024-09-28 09:42:28
,
所有人可见
,
阅读 1
#include <iostream>
using namespace std;
int main(void)
{
double wage;
double total = 0;
cin >> wage;
if (wage <= 2000) {
cout << "Isento" << endl;
} else if (wage >= 2000.01 && wage <= 3000) {
total = (wage - 2000) * 0.08;
printf("R$ %.2f\n", total);
} else if (wage >= 3000.01 && wage <= 4500) {
double tax1 = 1000 * 0.08;
double tax2 = (wage - 3000) * 0.18;
total = tax1 + tax2;
printf("R$ %.2f\n", total);
} else if (wage > 4500) {
double tax1 = 1000 * 0.08;
// printf("tax1 %.2f\n", tax1);
double tax2 = 1500 * 0.18;
// printf("tax2 %.2f\n", tax2);
double tax3 = (wage - 4500) * 0.28;
// printf("tax3 %.2f\n", tax3);
total = tax1 + tax2 + tax3;
printf("R$ %.2f\n", total);
}
return 0;
}