填空题
给定程序通过定义并赋初值的方式,利用结构体变量存储了一名学生的学号、姓名和3门课的成绩。函数fun的功能是将该学生的各科成绩都乘以一个系数a。
请在程序的下画线处填入正确的内容,使程序得出正确的结果。
注意:部分源程序给出如下。
不得增行或删行,也不得更改程序的结构!
试题程序:
#include <stdico.h>
typedef struct
{ int hum;
char name [9];
float score[3];
} STU;
void show(STU tt)
{ int i;
printf("%d%s;",tt.num,tt.name);
for(i=0; i<3; i++)
printf("%5.1f",tt.score[i]);
printf("/n");
}
/**********found**********/
void modify(
1 *ss,float a)
{ int i;
for(i=0; i<3; i++)
/**********found**********/
ss->
2 *=a;
}
main( )
{ STU std={1,"Zhanghua",76.5,78.0,82.0};
float a;
printf("/nThe original number and name and scores:/n");
show(std);
printf("/nInput a number:");
scanf("%f",&a);
/**********found**********/
modify(
3,a);
printf("/nA result of modifying:/n");
show(std);
}