字数自己补int i,a[20],Positive=0,Sum=0;printf("任意输入20个整数:\n");for (i=0;i<20;i++){scanf("%d",&a[i]);if (a[i]>0){Positive++;Sum+=a[i];}}printf("有%d个非负数,他们的和为:%d。\n",Positive,Sum);
#include
void main()
{ int i,a[20],count=0,sum=0;
for(i=0;i<20;i++) scanf("%d",&a[i]);
for(i=0;i<20;i++) if(a[i]>=0) count++;sum+=a[i];
printf("个:%d,tot:%d",count,sum);}