假设月入个人所得稅起征点为 5000 元,超过起征点的部分 需要对其征收个人所得税。
超出部分如果小于 3000 元,则超过部分被征收 3%的税。
如果超过部分为 3000 至 12000(不包含 12000)元,则超过部分按照 10%的税率征稅。如果超过部分为 12000至25000(不包含 25000)元,则超过部分技照 20的稅率征稅。
…25000 至 35000(不包含35000)元,则超过部分按照 25%的稅率征税。
…35000 至55000(不包含:55000)元,则超过部分按照 30%的稅率征稅。
55000至80000(不包含-80000)元,超过部分按照 35%的稅率征税。
如果超过部分大于等于 80000 元,则超过部分按照 45%的稅率征稅。
设计一个程序,输入个人当月稅前收入,通过上述个稅计算规则,输出其稅后实际收入。
#include <stdio.h>
int main() {
float income, tax;
float threshold = 5000; // 个人所得税起征点
printf("请输入当月税前收入:");
scanf("%f", &income);
if (income <= threshold) {
tax = 0; // 未超过起征点,不需要交税
} else if (income - threshold < 3000) {
tax = (income - threshold) * 0.03; // 超过起征点但不足3000元
} else if (income - threshold < 12000) {
tax = (income - threshold - 3000) * 0.1 + 90; // 超过3000元但不足12000元
} else if (income - threshold < 25000) {
tax = (income - threshold - 12000) * 0.2 + 990; // 超过12000元但不足25000元
} else if (income - threshold < 35000) {
tax = (income - threshold - 25000) * 0.25 + 2990; // 超过25000元但不足35000元
} else if (income - threshold < 55000) {
tax = (income - threshold - 35000) * 0.3 + 6740; // 超过35000元但不足55000元
} else if (income - threshold < 80000) {
tax = (income - threshold - 55000) * 0.35 + 12940; // 超过55000元但不足80000元
} else {
tax = (income - threshold - 80000) * 0.45 + 21940; // 超过80000元
}
float netIncome = income - tax; // 税后实际收入
printf("当月税后实际收入为:%.2f元\n", netIncome);
return 0;
}
#include <stdio.h>
int main()
{
int a[10];
int i, count = 0, j, t;
for (i=0; i<10; i++)
{
scanf("%d", &a[i]);//输入数据
}
for (i=0; i<10; i++)//判断及格率
{
if (a[i]>=60)
{
count++;
}
}
if (count >= 7)
{
for (i=0; i<10; i++)
{
for (j=i+1; j<10; j++)
{
if (a[i]<a[j])
{
t = a[i];
a[i] = a[j];
a[j] = t;
}
}
}
for (i=0; i<10; i++)
{
printf ("%d ", a[i]);//输出数据
}
}
else
{
do
{
count = 0;
for (i=0; i<10; i++)//找到第一个小于60的数
{
if (a[i]<60)
{
break;
}
}
for (j=i+1; j<10; j++)//从第i+1个数开始依次与i相比较与60 的差
{
if (a[j]<60 && (60-a[i])>(60-a[j]))
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
}
a[i] = 60;
for (i=0; i<10; i++)//判断及格率
{
if (a[i]>=60)
{
count++;
}
}
}while (count<7);
for (i=0; i<10; i++)
{
for (j=i+1; j<10; j++)
{
if (a[i]<a[j])
{
t = a[i];
a[i] = a[j];
a[j] = t;
}
}
}
for (i=0; i<10; i++)
{
printf ("%d ", a[i]);//输出数据
}
}
return 0;
}