新旧个人所得税比较

个税=应纳税收入×对应的税率-速算扣除数
tax1
tax2
tax3
tax4

#include 

float foo(float s, float *base, float *reduce, float *rate, float p)
{
	float t = 0;
	int i;
	if (s > p) {
		for (i = 0; base[i] != -1; i++)
			if ((s - p) <= base[i])
				break;
		t = (s - p) * rate[i-1] / 100 - reduce[i-1];
	}
	printf("[%.0f] Tax: %7.2f, Rate: %4.2f%%n", p, t, 100 * t / s);
	return t;
}

int main(void)
{
	float base_org[10] = {0, 500, 2000, 5000, 20000, 40000, 60000, 80000, 100000, -1};
	float reduce_org[9] = {0, 25, 125, 375, 1375, 3375, 6375, 10375, 15375};
	float rate_org[9] = {5, 10, 15, 20, 25, 30, 35, 40, 45};

	float base[8] = {0, 1500, 4500, 9000, 35000, 55000, 80000, -1};
	float reduce[7] = {0, 105, 555, 1005, 2755, 5505, 13505};
	float rate[7] = {3, 10, 20, 25, 30, 35, 45};

	float s, tax_org, tax;
	printf("Pls intput salary w/o INSURANCE,PENSION,HOUSING FUND: ");
	scanf("%f", &s);
	tax_org = foo(s, base_org, reduce_org, rate_org, 2000);
	tax = foo(s, base, reduce, rate, 3500);
	printf("Salary: %8.2f, Reduced Tax: %4.2fn", s, tax_org - tax);

	return 0;
}

@t400:~# ./a.out
Pls intput salary w/o INSURANCE,PENSION,HOUSING FUND: 6000
[2000] Tax:  475.00, Rate: 7.92%
[3500] Tax:  145.00, Rate: 2.42%
Salary:  6000.00, Reduced Tax: 330.00

One thought on “新旧个人所得税比较

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.