急求!!!!c语言课程设计-----<<统计工资>>.

来源:百度知道 编辑:UC知道 时间:2024/08/22 00:35:15
本课程设计要求设计一个公司职员的数据结构,并使用结构指针数组存储职员信息,统计公司员工工资总额和平均工资.

#include<stdio.h>
struct company
{
char name[20];
char num[20];
long money;
};
main()
{
int i=0,p=0;
flaot aver_money=0;
int money=0;
int return_num=0;
struct company human[200][200];
FILE *fp;
while(i<200)
{
while(p<200)
{
printf("输入姓名");
gets(human[i][p].name);
printf("员工的号码0");
getchar(human[i][p].num);
printf("输入员工工资");
scanf("%ld",human[i][p].money);
p++;
}
i++;
}

}
p=0;
i=0;
if((fp=fopen("f:1234,txt","w+")))
{
printf("you can not open the file!");
exit(1);

while(i<200)
{ p=0;
while(p&