#includevoid main(){ int n[20],i,sum=0,count=0; for(i=0;i<20;i++) { scanf("%d",&n[i]); if(n[i]>0) { sum+=n[i]; count++; } } printf("正数有%d个,它们的总和是%d",count,sum);}
#includeint main( void ){ int arr[ 20 ], i, sum = 0, count = 0; for( i=0; i<20; i++ ) { scanf( "%d", arr + i ); if( arr[ i ] > 0 ) { sum += arr[ i ]; count++; } } printf( "正数有%d个,它们的总和是%d\n", count, sum ); return 0;}