各位高手麻烦帮我看看这个程序为什么不能正常运行??急需帮助,谢谢!
工人工资管理系统:基本工资(jbgz),奖金(jj),保险(bx),实发工资(sfgz);#include"stdio.h"
#include"string.h"
struct salary{
float jbgz,jj,bx,sfgz;};
struct employee{
char num[15];
char name[15];
struct salary p;};
void Menu(){
printf("-------------------Menu--------------------\n");
printf("0------------------over--------------------\n");
printf("1----putout all worker's information:------\n");
printf("2----ji ben gong zi of every worker--------\n");
printf("3---------jiangjin of every worker---------\n");
printf("4----------baoxian of every worker---------\n");
}
void paixu1(struct employee e[],int n)
{int i,k,min;
struct employee t;
for(k=0;k<=n-2;k++)
{ min=k;
for(i=k+1;i<=n-1;i++)
if(e[i].p.sfgz<e[min].p.sfgz) min=i;
t=e[min];
e[min]=e[k];
e[k]=t;}
for(i=0;i<n-1;i++)
{ printf("%s %s",e[i].num,e[i].name);
printf("%f %f %f %f\n",e[i].p.jbgz,e[i].p.jj,e[i].p.bx,e[i].p.sfgz);
}
}
void jbgzp(struct employee e[],int n)
{int i,count=1,k,max;
struct employee t;
while(count!=n-1)
{ k=0;
max=k;
for(i=k+1;i<=n-count;i++)
if(e[i].p.jbgz>e[max].p.jbgz) max=i;
t=e[max];
e[max]=e[n-count];
e[n-count]=t;
count++;}
for(i=0;i<n-1;i++)
printf("%s %s %f\n",e[i].num,e[i].name,e[i].p.jbgz);
}
void jiangjinp(struct employee e[],int n)
{ int i,k,min;
struct employee t;
for(k=0;k<=n-2;k++)
{ min=k;
for(i=k+1;i<=n-1;i++)
if(e[i].p.jj<e[min].p.jj) min=i;
t=e[min];
e[min]=e[k];
e[k]=t;}
for(i=0;i<=n-1;i++)
printf("%s %s %f\n",e[i].num,e[i].name,e[i].p.jj);
}
void baoxianp(struct employee e[],int n)
{int i,k,max,count=1;
struct employee t;
while(count!=n-1)
{ k=0;
max=k;
for(i=k+1;i<=n-count;i++)
if(e[i].p.bx>e[max].p.bx) max=i;
t=e[max];
e[max]=e[n-count];
e[n-count]=t;
count++;}
for(i=0;i<=n-1;i++)
printf("%s %s %f\n",e[i].num,e[i].name,e[i].p.bx);
}
void main()
{ int i=-1,n,k,j;
struct employee e[50];clrscr();
printf("please enter these employee's information:\n");
printf("the information include number name jbgz jj bx:\n");
do{
i=i+1;
scanf("%s%s%f%f%f",e[i].num,e[i].name,&e[i].p.jbgz,&e[i].p.jj,&e[i].p.bx);
e[i].p.sfgz=e[i].p.jbgz+e[i].p.jj-e[i].p.bx;
printf("enter 0 is over,1 is continu:");
scanf("%d",&j);
}while(j==1);
n=i+1;
Menu();
do{
printf("please choice:\n");
scanf("%d",&k);
switch(k){
case 0:printf("Thank you for use!");break;
case 1:printf("all worker's information is:\n");
paixu1(e,n);
break;
case 2:printf(" ji ben gong zi of every worker is:\n");
jbgzp(e,n);
break;
case 3:printf("jiang jin of every worker is:\n");
jiangjinp(e,n);
break;
case 4:printf("bao xian of every worker is:\n");
baoxianp(e,n);
break;
}
}while(k!=0);
getchar();
getchar();
}