hihoCoder - 1102 - Individual Income Tax (数学~)

#1102 : Individual Income Tax

时间限制:10000ms

单点时限:1000ms

内存限制:256MB

描述

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;
}
时间: 2024-08-06 11:29:33

hihoCoder - 1102 - Individual Income Tax (数学~)的相关文章

CN00 与CN28 区别

做过SAP HR的大都知道,SAP在中国区提供的Payroll schema有两个,一个是CN00,一个是CN28.两者最大的区别是,一个是把计税的结果带到当月,另外一个是把税基带到当月. 我现在碰到了一个客户,它的需求是,如果上月员工有发薪水(存在Payroll result),那么就把税基带到本月,如果上月员工薪水就没有发,那么就把税的结果带到本月: 于是我便仔细研究这两个schema的差别的出结果如下 首先来看看SAP标准的schema处理两种算税模式时候的差别: 1.         C

Handbook of Document Image Processing and Recognition文档图像处理与识别手册

编辑:David Doermann(马里兰大学)Karl Tombre(洛林大学) 前言 In the beginning, there was only OCR. After some false starts, OCR became a competitive commercial enterprise in the 1950’s. A decade later there were more than 50 manufacturers in the US alone. With the a

美国政府关于Google公司2013年度的财务报表红头文件

请管理员移至新闻版块,谢谢! 来源:http://www.sec.gov/ 财务报表下载↓ 此文仅作参考分析. 10-K 1 goog2013123110-k.htm FORM 10-K UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, D.C. 20549     FORM 10-K (Mark One)       ý ANNUAL REPORT PURSUANT TO SECTION 13 OR 15(d) OF TH

英语新闻常用词汇与短语

英语新闻常用词汇与短语 经济篇 accumulated deficit 累计赤字 active trade balance 贸易顺差 adverse trade balance 贸易逆差 aid 援助 allocation of funds 资金分配 allotment 拨款 allowance/grant/subsidy 补贴,补助金,津贴 amortization 摊销,摊还,分期偿付 annuity 年金 article 物品,商品 assigned 过户 autarchy 闭关自守 av

Oracle Global Finanicals Oracle Global Financials Technical Reference(一)

Skip Headers Oracle Global Finanicals Oracle Global Financials Technical Reference Manual Release 11i         Globalization Flexfields This document describes the globalization flexfields that store certain pieces of country- and region-specific info

Manifesto of the Communist Party

A spectre is haunting Europe – the spectre of communism. All the powers of old Europe have entered into a holy alliance to exorcise this spectre: Pope and Tsar, Metternich and Guizot, French Radicals and German police-spies. Where is the party in opp

Term of Wall Street

Financial Terminology Capital Market,资本市场,主要用于大于一年的投资. (Financing, 融资,资本市场存在的目的. Security, 证券. Securities Act (1933), 证券法案, Senior Security, 优先级证券,包括债券和优先股. Stock, 股票 (Preferred Stock, 优先股 间于Bond和Common Stock 红利,由董事会决定是否分发当年红利,董事会可决定将优先股的红利用于再投资,在资金充

The bumperz is probably their most favorite floatie

Great https://www.inflatable-zone.com/inflatable-bouncer/inflatable-combo.html , everyone loves it. I've had this pool toy now for 3 seasons and it's still functioning with no holes or rips! We are somewhat careful about having adults use it but othe

[zz]爱因斯坦名言和世界观

* 一个人的价值,应该看他贡献什么,而不应当看他取得什么. * 没有宗教的科学是跛的,没有科学的宗教是瞎的. * 只要我还能有所选择,我就只想生活在这样的国家里,这个国家中所实行的是:公民.自由.宽容,以及在法律面前公民一律平等.公民自由意味着人们有用言语和文字表示其政治信念的自由:宽容意味着尊重别人的无论哪种可能有的信念.这些条件目前在德国都不存在.那些对国际谅解事业有特别重大贡献的人,在那里正受到迫害,其中就有一些是一流的艺术家. * 测量一个物体的质量就是测量其中的能量. 原文:The m