功能:数组名作为函数参数,求平均成绩。#include"stdio.h"floataver(floata[]){inti;floatav,s=a[0];for(i=1;i<5;i++)/***********SPACE***********/s+=【?】[i];av=s/5;/***********SPACE***********/return【?】;}voidmain(){floatsco[5],av;inti;printf(" input5scores: ");for(i=0;i<5;i++)/***********SPACE***********/scanf("%f",【?】);/***********SPACE***********/av=aver(【?】);printf("averagescoreis%5.2f ",av);}
功能:数组名作为函数参数,求平均成绩。#include"stdio.h"floataver(floata[]){inti;floatav,s=a[0];for(i=1;i<5;i++)/***********SPACE***********/s+=【?】[i];av=s/5;/***********SPACE***********/return【?】;}voidmain(){floatsco[5],av;inti;printf(" input5scores: ");for(i=0;i<5;i++)/***********SPACE***********/scanf("%f",【?】);/***********SPACE***********/av=aver(【?】);printf("averagescoreis%5.2f ",av);}
1