#define N 2
struct bri
{
int year;
int mouth;
int day;
}br;
struct student /* 结构体 */
{
int num[6]; /* 学号6位 */
char name[20]; /* 姓名 */
char sex; /* 性别 */
struct bri br; /* 结构体调用 */
float score[N]; /* 输入几门成绩 */
float average;
};
void input();
void output();
#include "stdio.h"
main()
{
int i;
struct student stu[N]; /* 结构体调用 */
input(); /* 输入函数调用 */
output(); /* 输出函数调用 */
getch();
}
void input()
{
int i;
struct student stu[N];
for(i=0;i<N;i++)
{
printf("please input NO.%d",i+1);
printf("\nplease input student num:");
scanf("%d",&stu[i].num[6]);
printf("\nplease input student name:");
scanf("%s",&stu[i].name);
printf("\nPlease input student sex:");
scanf("%s",&stu[i].sex);
printf("\nPlease input student chu bir:");
scanf("%d,%d,%d",&stu[i].br.year,&stu[i].br.mouth,&stu[i].br.day); }
}
void output()
{
}
后面输出你自己看