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