试题编号: | 201612-2 |
试题名称: | 工资计算 |
时间限制: | 1.0s |
内存限制: | 256.0MB |
问题描述: | 问题描述 小明的公司每个月给小明发工资,而小明拿到的工资为交完个人所得税之后的工资。假设他一个月的税前工资(扣除五险一金后、未扣税前的工资)为S元,则他应交的个人所得税按如下公式计算: 输入格式 输入的第一行包含一个整数T,表示小明的税后所得。所有评测数据保证小明的税前工资为一个整百的数。 输出格式 输出一个整数S,表示小明的税前工资。 样例输入 9255 样例输出 10000 评测用例规模与约定 对于所有评测用例,1 ≤ T ≤ 100000。 |
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <time.h>
#include <vector>
#include <list>
using namespace std;
//int money[10] = {1455,2700,3600,19500,14000,16250}
double money[8] = {0,3500,3500+1455,3500 + 4155,3500 + 7755,3500 + 27255,3500 + 41255,3500 + 57505};
double pay[8] = {0, 3500,3500 + 1500,3500 + 4500,3500 + 9000,3500 + 35000,3500 + 55000,3500 + 80000 };
double rate[8] = { 0,0.03,0.1,0.2,0.25,0.3,0.35,0.45 };
int main()
{
int i, j, N, flag = -1;
cin >> N ; //
for (i = 0; i < 8; i++)
{
//cout << money[i] << endl;
if (N < money[i])
{
flag = i-1;
break;
}
}
if (flag == -1)
flag = 7;
int Out = pay[flag] + (N - money[flag]) / (1 - rate[flag]);
cout << Out;
cin >> N;
return 0;
}