您好,欢迎来到百家汽车网。
搜索
您的当前位置:首页二级C语言练习题21

二级C语言练习题21

来源:百家汽车网
程序通过定义并赋初值的方式,利用结构体变量存储了一名学生的信息。函数fun的功能是输出这位学生的信息。

#define_CRT_SECURE_NO_WARNINGS #include #include #include #defineN80 typedefstruct {

intnum; charname[9]; charsex; struct {

intyear; intmonth; intday;

}birthday; floatscore[3];

}STU;

voidshow(STUtt) { }

voidmain() { }

STUstd={1,\"Zhanghua\",'M',1961,10,8,76.5,78.0,82.0}; printf(\"\\nA student data:\\n\"); show(std); system(\"pause\"); inti;

printf(\"\\n%d %s %c %d-%d-%d,\",tt.num,tt.name,tt.sex,tt.birthday.year,tt.birthday.mofor(i=0;i<3;i++) { }

printf(\"\\n\");

printf(\"%5.1f\",tt.score[i]);

nth,tt.birthday.day);

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- baijiahaobaidu.com 版权所有 湘ICP备2023023988号-9

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务