资源描述:
《员工工资管理》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#include"stdio.h"#include"stdio.h"#include"malloc.h"#include“stdlib.h”#include"string.h"typedefstructyg(charname[20];intage;chargs[30];floatgz;structyg*next;}person;person*head,*p,*q,*m;floattotal=0;intcount=0;#defineL61#defineH65voidcipan(){FILE*w;if((w二fopen(”员工“,”wb”))=NULL)printf(”NO“);p=head->n
2、ext;for(:p;p=p->next){fwrite(p,sizeof(person),1,w);print”写入J;fclose(w);voidbgoutput()//for(k=l;k<=N;k++)fbr(k=l;k<=H;k++)打印方格的行putchar(45);putchar(,);for(j=l;j<=L;j++)打卬方格的列//for(j=l;j<=N;j++)if(j==1){putchar(l24);printf(H姓名n);printf(H%*cM1;);}if(j==21){putchar(124);printf("公司”);printf("%*c",ll,*)
3、;}if(j==41){putchar(124);printf(M年龄n);printf(,,%*c',,ll;^;}if(j==61){putchar(l24);printf(H工资,,);printf(,,%*c,,,l1;');}if(j==61){putchar(124);}putchar(r);p=head->next;for(i=1;i<=(count+l);i++)//for(;i<=10;i++)控制行数for(k=1;kv二H;k++)//for(k=1;kv二N;k++)打印方格的行putchar(45);putchar(r);if(j==(count+l))bre
4、ak;for(j=1;jv=L;j++)打印方格的列//for(j=1;j<=N;j++)if(i==count+1)break;{putchar(124);x=strlen(p->name)if(j==Dprintf(n%s",p->name);printf("%*cn,15-x,'');}if(j==21){putchar(124);x=strlen(p->gs);printf("%s',,p->gs);printf(,'%*c',,15-x,');}if(j==41){putchar(124);x=0;y=p->age;while(y)y=y/l();x++;printf("%dn,p-
5、>age);printf(15-x,'');if(j==61){putchar(l24);x=0;r=(int)(p->gz);while(r)r=r/10;x++;printf(n%.2fp->gz);printf(l,%*c,12-x/putchar(I24);p=p->next;piHcharC'n);for(j=1;j<=L;j++)//for(j=1;j<=L;j++)最后一列if(j==l)if(j==2Dif(j==41)if(j==61){putchar(124);printf(n总计");printf(H%*cH,l1,‘');){putchar('r);printf(M
6、%*c",15,'');}{putcharCr);printf(,,%*cn,15;');}{putchar(124);r=(int)(total);while(r)r=r/10;x++;printf(n%.2ftotal);printf(u%*c,12-x;J;putchar(124);//for(i=1;i<=1;i++)最后一行putchaK'n1);for(i=l;i<=H;i++)putchar(45);〃第二个输出和方格的结合voidlianbiao(){inti=0,N;printf(n输入人数:M);scanf(M%d",&N);count+=N;head=p=(per
7、son*)malloc(sizeof(person));if(p==NULL){printf("无法开辟内存空间*');exit(0);}printf(u开始创建首节点后的节点”);printfC输入姓名部门年龄工资“);while(i