填空题
以下程序从终端读入数据到数组中,统计其中正数的个数,并计算它们之和。请填空。
main()
int i, a[20], sum, count;
sum=count=0;
for(i=0; i<20; i++)scanf("% d",
);
for(i=0; i<20; i++)
if(a[i]>0)
count++;
sum+=a[i];
printf("sum=% d, count=% d\\n", sum, count);
【参考答案】
&a[i]
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
已有定义如下: struct node int data; struct node *next; *p; 以下语句调用malloc函数,使指针p指向一个具有struct node类型的动态存储空间。请填空。 p=(struct node *)malloc( );
点击查看答案&解析
填空题
以下程序运行后的输出结果是 。 #include <stdio.h> msin() int i,n[]=0,0,0,0,0; for(i=1;i<=4;i++) n[i]=n[i-1]*2+1; printf( %d ,n[i]);
点击查看答案&解析
相关试题
下面rotate函数的功能是:将n行n列的矩阵A...
有下面的程序:#include <stdio, h>m...
在面向对象方法中,类的实例称为______。
以下程序中函数huiwen的功能是检查一个字符...
表示“整数x的绝对值大于5”时值为“假”...