赞
踩
- include <stdio.h>
- #include <stdlib.h>
-
- typedef struct stu
- {
- char xm[10];
- int bh;
- float gz;
- } xx;
-
- xx shuru(xx *wage,int n)
- {
- int i;
- for(i=0;i<n;i++)
- {
- scanf("%s",&wage[i].xm);
- scanf("%d",&wage[i].bh);
- scanf("%f",&wage[i].gz);
- }
- }
-
- float jiaoshui(float q,int n)
- {
- int i,m;
- float js;
- q=q-3500;
- for(i=0;i<n;i++)
- {
- if(q<=0)
- m=1;
- else if(q<=1500&&q>0)
- m=2;
- else if(q<=4500&&q>1500)
- m=3;
- else if(q<=9000&&q>4500)
- m=4;
- else if(q<=35000&&q>9000)
- m=5;
- else if(q<=55000&&q>35000)
- m=6;
- else if(q<=80000&&q>55000)
- m=7;
- else m=8;
- }
- switch(m)
- {
- case 1:
- js=0;
- break;
- case 2:
- js=q*0.03;
- break;
- case 3:
- js=q*0.1-105;
- break;
- case 4:
- js=q*0.2-555;
- break;
- case 5:
- js=q*0.25-1005;
- break;
- case 6:
- js=q*0.3-2755;
- break;
- case 7:
- js=q*0.35-5505;
- break;
- case 8:
- js=q*0.45-13505;
- }
- return js;
- }
-
-
- int main()
- {
- int n,k;
- float q,js,sh;
- xx *wage;
- while(1)
- {
- printf("请输入员工人数:\n");
- scanf("%d",&n);
- wage=(int *)malloc(n*sizeof(int));
- printf("请输入姓名,编号,工资:\n");
- shuru(wage,n);
- for(k=0;k<n;k++)
- {
- q=wage[k].gz;
- js=jiaoshui(q,n);
- sh=q-js;
- printf("姓名:%s 编号:%d 交税:%f 税后工资:%f\n",wage[k].xm,wage[k].bh,js,sh);
- }
- }
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。