c语言编程练习题:7-97 计算个人所得税
作者:yunjinqi   类别:    日期:2023-05-31 10:37:25    阅读:123 次   消耗积分:0 分    

image.png

#include <stdio.h>
#include <math.h>
int main(){
    double money,result=0.0;
    if (scanf("%lf",&money)!=EOF){
        // printf("%f %f %f",money,year,rate);
        if (money<=1600){result=0.0;}
        if (1600 < money && money <= 2500){result=(money-1600)*0.05;}
        if (2500 < money && money <= 3500){result=(money-1600)*0.1;}
        if (3500 < money && money <= 4500){result=(money-1600)*0.15;}
        if (money > 4500){result=(money-1600)*0.2;}
        
        printf("%.2f",result);
    }else{
        printf("input wrong");
    }
    return 0;
}


版权所有,转载本站文章请注明出处:云子量化, http://www.woniunote.com/article/222
上一篇:c语言编程练习题:7-96 计算存款利息
下一篇:c语言编程练习题:7-98 两个数的简单计算器