C语言入门之工资计算

#include

int main()
{
//	1.请输入税前工资:
	int money = 0;
	printf("请输入您的税前工资:");
	scanf("%d",&money); 
//	2.养老保险:个人8% 单位12%
	double yangLao1 = money * 0.08;
	double yangLao2 = money * 0.12;
//	3.医疗保险:个人2% 单位7%
	double yiLiao1 = money * 0.02;
	double yiLiao2 = money * 0.07;
//	4.实业保险:个人0.1% 单位0.2%
	double shiYe1 = money * 0.001;
	double shiYe2 = money * 0.002;
//	5.工伤保险:个人不用交 单位0.4%
	double gongShang2 = money * 0.004;
//	6.生育保险:个人不用交 单位0.85%
	double shengYu2 = money * 0.0085;
//	7.住房公积金:个人12% 单位12%
	double zhuFang1 = money * 0.12;
	double zhuFang2 = money * 0.12;	
//	8.个人所得税 全月应缴税额*税率-速算扣除数
	double shui1 = yangLao1 + yiLiao1 + shiYe1 + zhuFang1;
	double shui2 = money - shui1 -3500; //应缴纳纳税额 
	double shui3; //个人所得税 	
	if(shui2 <= 1500) 
		double shui3 = shui1 * 0.03;
	else if(shui2 >1500 && shui2 <= 4500)
		shui3 = shui2 * 0.1 - 105;
	else if(shui2 >4500 && shui2 <= 9000) 
		shui3 = shui2 * 0.2 - 555;
	else if(shui2 >9000 && shui2 <= 35000) 
		shui3 = shui2 * 0.25 - 1005;
	else if(shui2 >35000 && shui2 <= 55000) 
		shui3 = shui2 * 0.30 - 2755;
	else if(shui2 >55000 && shui2 <= 80000) 
		shui3 = shui2 * 0.35 - 5505;
	else 
		shui3 = shui2 * 0.45 - 13505;
//	9.全月应缴纳税额的计算方式为:税前工资-当月个人缴纳五险一金的金额-3500
	double money2 = money - shui1 - shui3;
	double gongSi1 = yangLao2 + yiLiao2 + shiYe2 + gongShang2 + shengYu2 + zhuFang2; 
	double gongSi2 = money + gongSi1;
	printf("*****************工资清单*****************\n");
	printf("个人交纳养老保险:%.2lf,",yangLao1);
	printf("单位交纳养老保险:%.2lf\n",yangLao1); 
	printf("个人交纳医疗保险:%.2lf,",yiLiao1);
	printf("单位交纳医疗保险:%.2lf\n",yiLiao2);
	printf("个人交纳失业保险:%.2lf,",shiYe1);
	printf("单位交纳失业保险:%.2lf\n",shiYe2);
	printf("单位交纳工伤保险:%.2lf\n",gongShang2);	
	printf("单位交纳工伤保险:%.2lf\n",shengYu2);
	printf("个人交纳住房公积金:%.2lf,",zhuFang1);
	printf("单位交纳住房公积金:%.2lf\n",zhuFang2);
	printf("个人所得税:%.2lf\n,",shui3);
	printf("税后工资:%.2lf\n",money2);
	printf("单位用工成本:%.2lf\n",gongSi2);	 
	return 0;
 } 

你可能感兴趣的:(C语言入门之工资计算)