C语言之输入月收入,输出该月应纳税额-2019(简易版)

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define s1 0.03  //税率b <= 3000
#define k1 0     //速算扣除数b <= 3000

#define s2 0.1   //税率3000 < b <= 12000
#define k2 210  //速算扣除数3000 < b <= 12000

#define s3 0.2   //税率12000 < b <= 25000
#define k3 1410  //速算扣除数12000 < b <= 25000

#define s4 0.25  //税率25000 < b <= 35000
#define k4 2660  //速算扣除数25000 < b <= 35000

#define s5 0.30  //税率35000 < b <= 55000
#define k5 4410  //速算扣除数35000 < b <= 55000

#define s6 0.35  //税率55000 < b <= 80000
#define k6 7160  //速算扣除数55000 < b <= 80000

#define s7 0.45  //税率b >80000
#define k7 15160 //速算扣除数b >80000

void main()
{
    long int a;  //月收入
    long int b;  //月应纳税所得
    long int c;  //应纳税额


    printf("请输入您的月收入:");
    scanf("%d",&a);
    
    b = a - 5000;

    printf("%d",b);

    if(b <= 0)
    {
        c = 0;
    }
    else if(0 < b && b <= 3000)
    {
        c = b * s1 - k1;
    }
    else if(3000 < b && b <= 12000)
    {
        c = b * s2 - k2;
    }
    else if(12000 < b && b <= 25000)
    {
        c = b * s3 - k3;
    }
    else if(25000 < b && b <= 35000)
    {
        c = b * s4 - k4;
    }
    else if(35000 < b && b<= 55000)
    {
        c = b * s5 - k5;
    }
    else if(55000 < b && b<= 80000)
    {
        c = b * s6 - k6;
    }
    else
    {
        c = b * s7 - k7;
    }

    printf("您的月应纳税额为:%d",c);
    
    printf("\n");
    system("pause");
    return ;
}

 

posted @ 2019-03-26 10:09  Jony-2018  阅读(1222)  评论(0编辑  收藏  举报