用C语言编程 个人所得税计算器

用C语言编程 个人所得税计算器

首页维修大全综合更新时间:2023-06-27 05:44:44

用C语言编程 个人所得税计算器

代码:

#include <stdio.h>

int main()

{

double income, deduction = 0;

scanf("%lf", &income);

int level = (income > 1500) +

(income > 4500) +

(income > 9000) +

(income > 35000) +

(income > 55000) +

(income > 80000) ;

switch(level)

{

case 2:

deduction += (income - 4500) * 0.2;

income = 4500;

case 1:

deduction += (income - 1500) * 0.1; income = 1500;case 0: deduction += 1500 * 0.03;

}

printf("%.2f ", deduction);

return 0;

}

大家还看了
也许喜欢
更多栏目

© 2021 3dmxku.com,All Rights Reserved.