- //
- // main.c
- // HomeWork_18
- //
- // Created by 蒋伟 on 16/5/7.
- // Copyright (c) 2016年 蒋伟. All rights reserved.
- //
- #include <stdio.h>
- int main(int argc, const char * argv[]) {
- printf("欢迎使用工资计算软件!\n");
- printf("请输入您的税前工资:");
- float gongZi;
- scanf("%f",&gongZi);
- float yangLaoG = gongZi * 0.08;
- float yangLaoD = gongZi * 0.12;
- float yiLiaoG = gongZi * 0.02;
- float yiLiaoD = gongZi * 0.07;
- float shiYeG = gongZi * 0.001;
- float shiYeD = gongZi * 0.002;
- float gongShangD = gongZi * 0.004;
- float shengYuD = gongZi * 0.0085;
- float gongJiJinG = gongZi * 0.12;
- float gongJiJinD = gongZi * 0.12;
- float jiShuiGongZi = gongZi * (1 - 0.08 - 0.02 - 0.001 - 0.12) - 3500;
- float geRenSuoDeShui = 0;
- if(jiShuiGongZi > 80000){
- geRenSuoDeShui = jiShuiGongZi * 0.45 - 13505;
- }else if(jiShuiGongZi > 55000){
- geRenSuoDeShui = jiShuiGongZi * 0.35 - 5505;
- }else if(jiShuiGongZi > 35000){
- geRenSuoDeShui = jiShuiGongZi * 0.3 - 2755;
- }else if(jiShuiGongZi > 9000){
- geRenSuoDeShui = jiShuiGongZi * 0.25 - 1005;
- }else if(jiShuiGongZi > 4500){
- geRenSuoDeShui = jiShuiGongZi * 0.2 - 555;
- }else if(jiShuiGongZi > 1500){
- geRenSuoDeShui = jiShuiGongZi * 0.1 - 105;
- }else if(jiShuiGongZi > 0 && jiShuiGongZi <= 1500){
- geRenSuoDeShui = jiShuiGongZi * 0.03;
- }
- float shuiHouGongZi = jiShuiGongZi + 3500 - geRenSuoDeShui;
- printf("**************工资清单**************\n");
- printf("个人缴纳养老保险:%.2f元,单位缴纳养老保险:%.2f元\n",yangLaoG,yangLaoD);
- printf("个人缴纳医疗保险:%.2f元,单位缴纳医疗保险:%.2f元\n",yiLiaoG,yiLiaoD);
- printf("个人缴纳失业保险:%.2f元,单位缴纳失业保险:%.2f元\n",shiYeG,shiYeD);
- printf("单位缴纳工伤保险:%.2f元\n",gongShangD);
- printf("单位缴纳生育保险:%.2f元\n",shengYuD);
- printf("个人缴公积金:%.2f元,缴纳公积金:%.2f元\n",gongJiJinG,gongJiJinD);
- if(jiShuiGongZi > 0){
- printf("个人所得税:%.2f元\n",geRenSuoDeShui);
- printf("税后工资:%.2f元\n",shuiHouGongZi);
- }else{
- printf("不用缴纳个人所得税!\n");
- printf("税后工资:%.2f元\n",shuiHouGongZi);
- }
- return 0;
- }
复制代码
|
|