天天看點

收入與稅收

#include <stdio.h>
#include <stdlib.h>

typedef struct wage
{
    char name[];
    int jbm;
    int gwm;
    int jtm;

}WAGE;
int sd(float a)
{    float gs;
    if(a>&&a<=)
    gs=a*(/)-;
else if(a>&&a<=)
    gs=a*(/)-;
else if(a>&&a<=)
    gs=a*(/)-;
else if(a>&&a<=)
    gs=a*(/)-;
else if(a>&&a<=)
    gs=a*(/)-;
else if(a>&&a<=)
    gs=a*(/)-;
else if(a>)
    gs=a*(/)-;
   return gs;
}
int main()
{
    int i;
    float sum[],s[],m[];
    WAGE peo[]={
        {"劉",,,},
        {"張",,,},
        {"郭",,,},
        {"成",,,},
        {"皮吉",,,}
        };
   printf("姓名\t基本工資\t崗位工資\t津貼工資\t稅後收入\t個人稅收\n");
   for(i=;i<5;i++)
   {
       sum[i]=peo[i].jbm+peo[i].gwm+peo[i].jtm;
       s[i]=sd(sum[i]);
       m[i]=sum[i]-s[i];
       printf("%s\t%d\t%d\t%d\t%f\t%f\n",peo[i].name,peo[i].jbm,peo[i].gwm,peo[i].jtm,sum[i],s[i],m[i]);
   }

}

           
收入與稅收