名牌哥
2016-11-03 11:06
求解啊!
#include<stdio.h>
int main(){
int a,num,sum;
printf("请输入个人收入:");
scanf("%d",&a);
if(a>0 && a<5000){
num = a*0.03;
sum = a-num-0;
}
else if(a<8000){
num = a*0.1;
sum = a-num-105;
}
else if(a<12500){
num = a*0.2;
sum = a-num-555;
}
else if(a<35800){
num = a*0.25;
sum = a-num-1005;
}
else if(a<58500){
num = a*0.30;
sum = a-num-2765;
}
else if(a<83500){
num = a*0.35;
sum = a-num-5505;
}
else{
num = a*0.45;
sum = a-num-13505;
}
printf("应缴纳的个人所得税是:%d元\n",num);
printf("纳税后的收入为:%d元\n",sum);
}
用if else语句,讲不通的变量分离开,在进行函数的运算
C语言入门
926209 学习 · 20797 问题
相似问题