-->
当前位置:首页 > 题库 > 正文内容

函数题:月纳税额计算

Luz3年前 (2022-09-23)题库905
本题目要求读入每月工资,计算按月需要累计缴纳的税额(税率见下图),此处只需显示应缴纳的税额,无需减去已缴纳部分。结果保留两位小数。 注意:每月有5000元免税额。

![1.png](~/607c0fbc-890d-4d6b-ae87-9dfa293264c6.png)
上图为按年累计应纳税所得额

### 函数接口定义:
c++
double m_tax(double salary,int month);

其中salary和 month 是用户传入的参数,函数返回每月累计应纳税额。


### 裁判测试程序样例:
c++
#include<stdio.h>

double m_tax(double salary,int month);

int main()
{
double money,tax,sum=0;
int i;
for(i=1;i<=12;i++)
{
scanf("%lf",&money);
sum+=money;
tax=m_tax(money,i);
printf("the sum of %d months tax is %.2f\n",i,tax);
}
return 0;
}
/* 请在这里填写答案 */


### 输入样例:

in
1000
2000
10000
5000
8000
500
2000
15000
1000
5000
6000
9000


### 输出样例:

在这里给出相应的输出。例如:

out
the sum of 1 months tax is 0.00
the sum of 2 months tax is 0.00
the sum of 3 months tax is 0.00
the sum of 4 months tax is 0.00
the sum of 5 months tax is 30.00
the sum of 6 months tax is 0.00
the sum of 7 months tax is 0.00
the sum of 8 months tax is 105.00
the sum of 9 months tax is 0.00
the sum of 10 months tax is 0.00
the sum of 11 months tax is 15.00
the sum of 12 months tax is 135.00

注意 :3月虽然工资为10000元,但3个月累计免税额为15000元,因此无需纳税。5月时累计免税额为25000元,累计工资收入为26000元,因此应纳税额为1000元,按税率为30元,后面同理所得。





答案:若无答案欢迎评论

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。