怎么会崩溃呢?
#include<stdio.h>#define n 1
struct employer
{int num;
char name[20];char sex[20];int salary1;int salary2;int salary3;};
struct employer emp[n];
main()
{
indata();
wages();
outdata();
}
indata()
{
int i;
printf("请输入员工编号、姓名、性别、基本工资和结构工资:\n");
for(i=0;i<n;i++)
{
scanf("%d%s%s%d%d%d",&emp[i].num,emp[i].name,emp[i].sex,
&emp[i].salary1,&emp[i].salary2);
}
}
wages()
{
int i;
for(i=0;i<n;i++)
{emp[i].salary3=emp[i].salary1+emp[i].salary2;}
}
outdata()
{
int i;
for(i=0;i<n;i++)
{
printf("%d %s %s %d %d %d",emp[i].num,emp[i].name,emp[i].sex,emp[i].salary1,emp[i].salary2,emp[i].salary3);
}
}