#include <stdio.h>
#include <stdlib.h>
#define N 4
struct minneed
{
char name[20];
char sex;
unsigned age;
float amount;
};
void outdate(struct minneed);
int main()
{
struct minneed needs[N]=
{
{"zhang",1,55,150.0},
{"chang",1,45,180.0},
{"g",1,0,154.0},
{"chen",1,51,125.0}
};
int i;
for(i=0;i<N;i++)
outdata(needs[i]);
system("pause");
return 0;
}
void outdate(struct minneed need1)
{
printf("\n姓名:%s\n",need1.name);
printf("\n性别:%s\n",(need1.sex==1)?"男":"女");
printf("年龄:%d\n",need1.age);
printf("地址:%f\n",need1.amount);
}