//2000>=收入>1000元部分,税率5%//3000>=收入>2000元部分,税率10%//6000>=收入>3000元部分,税率15%//收入>6000元部分,税率20%//输入某人的收入,计算出应纳税额及实际报酬#define _CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<stdlib.h>double x, num, y;doublefunction(double num){if(num <=1000)
y = num *1;elseif(num >1000&& num <=2000)
y = num *(1-0.05);elseif(num >2000&& num <=3000)
y =(num -2000)*(1-0.10)+1000+1000*0.95;elseif(num >3000&& num <=6000)
y =(num -3000)*(1-0.15)+1000+1000*0.95+1000*0.9;else
y =(num -6000)*(1-0.2)+1000+1000*0.95+1000*0.9+3000*0.85;return y;}intmain(){printf("请输入您的工资:\n");scanf("%lf",&x);function(x);printf("您的实际工资为:\n%lf", y);system("pause");}