#include
#include
#include
#define N 4
typedef struct list{
char name[5];
long num;
long tell;
char address[5];
int math;
int C;
}LIST;
LIST stu[N];
void test();
int total[N];
int main(){
int j;
test();
for (j=0;j<N;j++){
total[j]=stu[j].C+stu[j].math;
}
void xian(LIST P[N],int a[N]);
xian(stu,total);
return 0;
}
void test(){/*测试初始化*/
LIST stu01[4] =
{
{"李",201455,15079852222,"重庆",97,89},
{"张",201456,15073852222,"上海",97,95},
{"i",201457,15079886222,"松江",85,89},
{"李",201458,15079852962,"重庆",93,79}
};
memcpy(&stu[0],&stu01[0],sizeof(stu01)*4);
}
void xian(LIST P[N],int a[N]){/*显示*/
int i;
for (i=0;i<N;i++){
printf("\n");
printf("%s\t",P[i].name);
printf("%ld\t",P[i].num);
printf("%ld\t",P[i].tell);
printf("%s\t",P[i].address);
printf("%d\t",P[i].math);
printf("%d\t",P[i].C);
printf("%d\t",a[i]);
printf("%d\t",a[i]/2);
}
}