- #include<stdio.h>
- struct Student
- {
- char cName[20];
- float fscore[3];
- }student={
- "苏玉群",98.5f,89.0,93.5
- };
- void Display{
- struct Student stu
- }
- {
- printf("******** 学生成绩 ********\n");
- printf("姓名:%s\n",stu.cName);
- printf("语文:/\n",stu.fScore[0]);
- printf("数学:/\n",stu.fScore[1]);
- printf("英语:/\n",stu.fScore[2]);
- printf("平均成绩:/\n",(stu.fScore[0]+stu.fScore[1]+stu.fScore[2])/3);
- }
- int main()
- {
- Display(student)
- return 0;
- }
来源: http://www.bubuko.com/infodetail-3041188.html