原发布者:沃流域滔
#include"stdio.h"#include"stdlib.h"/*标准库函数*/#include"string.h"/*字符串操作函数*/#defineMAX5#definePAGE2#definePRINT1printf("--------------------------------------------------------------\n");#definePRINT2printf("number--name--class--sex--birth(yyyy-mm-dd)--age\n");#definePRINT3printf("%4d%5s%6d%6d%8d-%2d-%2d%12d\n",students[i].num,students[i].name,\students[i].classes,students[i].sex,students[i].birthday.year,\students[i].birthday.month,students[i].birthday.day,students[i].age);intsum;/*用来记录学生数目*//*清屏函数*/voidclrscr(){getchar();system("cls");}/*出生日期结构体类型*/structdate{intyear;intmonth;intday;};/*学生结构体类型*/structstudents_type{intnum;charname[20];intclasses;intsex;structdatebirthday;intage;}students[MAX],t;/*存放N个学生纪录的结构体数组*//*保存信息*/intsave_message(intsum){FILE*fp;inti;if((fp=fopen("studentsmessage.txt","wt+"))==NULL)/*貌似有问题*/{printf("wrong!\n");return0;}for(i=0;i