For incomes from wages and salaries, the progressive tax rate in excess of specific amount is applicable. The income amount taxable shall be the remainder after deducting 3500 yuan from the monthly income. The tax rate is below:
Grade Monthly Taxable Income |
Tax Rate(%) |
Income of 1,500 yuan or less |
3% |
That part of income in excess of 1,500 to 4,500 yuan |
10% |
That part of income in excess of 4,500 to 9,000 yuan |
20% |
That part of income in excess of 9,000 to 35,000 yuan |
25% |
That part of income in excess of 35,000 to 55,000 yuan |
30% |
That part of income in excess of 55,000 to 80,000 yuan |
35% |
That part of income in excess of 80,000 yuan |
45% |
Given the tax Little Hi paid, do you know his salary this month?
Line 1: M, the tax Little Hi paid. (1 <= M <= 5,000,000)
Line 1: Little Hi‘s salary. The number should be rounded dowm to the nearest integer.
Little Hi‘s salary is 15692 yuan. The tax is calculated below:
The income amount taxable is 15692 - 3500 = 12192 yuan.
That part of income of 1500 or less: 1500 * 3% = 45 yuan.
That part of income in excess of 1,500 to 4,500 yuan: 3000 * 10% = 300 yuan.
That part of income in excess of 4,500 to 9,000 yuan: 4500 * 20% = 900 yuan.
That part of income in excess of 9,000 to 35,000 yuan: (12192 - 9000) * 25% = 798 yuan.
Total tax is 45 + 300 + 900 + 798 = 2043 yuan.
2043
15692
根据你的税算出你的收入。。
AC代码:
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; int main() { double rate[10] = {0.03, 0.1, 0.2, 0.25, 0.3, 0.35, 0.45}; double b[10] = {0, 1500, 4500, 9000, 35000, 55000, 80000}; double a[10] = {0, 45, 300, 900, 6500, 6000, 8750}; for(int i=1; i<=6; i++) { a[i] += a[i-1]; } double m, ans; while(scanf("%lf", &m) != EOF) { for(int i = 6; i>=0; i--) { if(m > a[i]) { ans = b[i] + (m - a[i]) / rate[i]; break; } } printf("%d\n", (int)(ans + 0.1) + 3500); } return 0; }
hihoCoder - 1102 - Individual Income Tax (数学~)
原文地址:http://blog.csdn.net/u014355480/article/details/43578745