# in elude ” std io°h"#inc lude ”stnig
h”# in elud e " stdlib h"#d efine M 1 0i nt num;/计数struct S uden t{char xuehao[ 10];苗号char n ame[1 0];/ 姓名ehar sex[8]; 〃性别char biht [20];/出生年月h ar jiig a n[30];/ /籍贯eha r tel [(3 ];/ /电话int score;//成绩} s t udent [M];c har h eadl ine [80] ;/全局变量void rea d1(){FILE *fp;//文件指针iit=0;fp=f(pen (”jz011 °txt”,"r”)//打开文件if(p==NUL L){printfF 能找到文件,请检查
W );r etu rn;}fget s(h eadline,80 fp);//卖第一行的函数puts (headline );while
feof (fp ))//推断文件是否结束//for(i=〈M;i++){sfeanf (fp,”% s%s %s %s%s %s% d”,stude nt[i]nxehao, student[i]
name,student[i]
sex,sU dent [i] birth, tudent[i]jiguan,stu den t[i] tel,&stdent[]
seor e );i++"eanf 读两个空白字符之间的字符}num=i;f close(fp);/关闭文件for ( i=0; i〈 num ; i++)printf (”利 0,% 8 s%6s %16s% 16s %16s%6dW,studen [ i] xuehao,stu dent [i]
n ame , stud