...2,3,4,5,6,7,8,9,10};,编写程序,求a数组中偶数的个数和偶数的平均...答:int main(){ int i,num=0,sum=0,average=0;int a[]={1,2,3,4,5,6,7,8,9,10};for (i=0;i<10;i++){ if(a[i]%2==0){ num++;sum=sum+a[i];} } average = sum/num;printf("偶数的个数是%d, 平均值是%d\n",num,average);return 0;} ...
c语言改错题答:给你改好的。3、在考生文件夹下,给定程序MODI.C的功能是:求一维数组a中值为偶数的元素之和。例如,当一维数组a中的元素为:10,4,2,7,3,12,5,34,5,9 ,程序的输出应为:The result is: 62。请修改并运行该程序,然后将源程序文件MODI.C提交。include sum ( int arr[ ],int n ){ ...
求一维数组a中值为偶数的元素之和! 下面第二哥found下面怎么改?_百度...答:include <conio.h> include <stdio.h> main(){ int a[10]={10,4,2,7,3,12,5,34,5,9},i,s;clrscr();s = 0;/***found***/ for ( i=0; i<10; i++){ if (a[i] % 2 == 0)/***found***/ s+=a[i];} printf("The result is: %d\n", s);} for 语句 ...
...7,8,9,10,4,5}。求该数组中所有值为偶数的元素的和答:不能表示a数组元素的表达式是(B)a[10])---因为数组a的最大下标只能是9,即a[9], a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],一共10个元素