You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <bits/stdc++.h>
using namespace std;
int main() {
//税后所得为T元,税前工资S
int T, S, A;
cin >> T; //9255,目标反向求得S
//通过除100再乘100成功将十位和个位去掉保留百位以前的数字
S = T;
S /= 100;
S *= 100;
//以100为增量向上加找到结果
for (;; S += 100) {
int sum = 0;
A = S - 3500;
if (A <= 0) break;
//A中不超过1500元的部分税率3%
if (A >= 1500) sum += 1500 * 0.03;
if (A < 1500 && A > 0) sum += A * 0.03;
//A中超过1500元未超过4500元的部分税率10%
if (A >= 4500) sum += (4500 - 1500) * 0.1;
if (A > 1500 && A < 4500) sum += (A - 1500) * 0.1;
//A中超过4500元未超过9000元的部分税率20%
if (A >= 9000) sum += (9000 - 4500) * 0.2;
if (A > 4500 && A < 9000) sum += (A - 4500) * 0.2;
//A中超过9000元未超过35000元的部分税率25%
if (A >= 35000) sum += (35000 - 9000) * 0.25;
if (A > 9000 && A < 35000) sum += (A - 9000) * 0.25;
//A中超过35000元未超过55000元的部分税率30%
if (A >= 55000) sum += (55000 - 35000) * 0.3;
if (A > 35000 && A < 55000) sum += (A - 35000) * 0.3;
//A中超过55000元未超过80000元的部分税率35%
if (A >= 80000) sum += (80000 - 55000) * 0.35;
if (A > 55000 && A < 80000) sum += (A - 55000) * 0.35;
//A中超过80000元的部分税率45%
if (A >= 80000) sum += (A - 80000) * 0.45;
if (S - sum >= T)break;
}
cout << S << endl;
return 0;
}