填空题
以下程序从终端读入数据到数组中,统计其中正数的个数,并计算它们之和。请填空。 main() { int i, a[20], sum, count; sum=count=0; for(i=0; i<20; i++)scanf("% d",
【8】
); for(i=0; i<20; i++) { if(a[i]>0) { count++; sum+=a[i]; } } printf("sum=% d, count=% d\n", sum, count); }
【参考答案】
&a[i]
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
以下程序通过函数SunFun求。这里f(x)=x2+1,由F函数实现。请填空。 main() { printf( The sum=% d n , SunFun(10)); } SunFun(int n) { int x, s=0; for(x=0; x<=n; x++)s+=F( 【9】 ); return s; } F(int x) { return x*x+1; }
点击查看答案&解析
填空题
在面向对象方法中,类之间共享属性和操作的机制称为 【3】 。
点击查看答案&解析
相关试题
以下程序中函数huiwen的功能是检查一个宁符...
有以下程序:main(){ int num[4][...
以下程序运行后的输出结果是 【15】 。...
函数fun的功能是计算xn: double fun(do...
以下程序中,函数SumColumMin的功能是:求...