#includevoid main(){int a[10],i,countA=0,countB=0;for(i=0;i<10;i++){printf("请输入第%d个数:",(i+1));scanf("%d",&a[i]);if(a[i]>0){countA++;}if(a[i]%2==0){countB++;}}printf("正数的和是:%d,偶数和是:%d\n",countA,countB);}
#include int main() { int i,s1=0,s2=0,a[10]; for(i=0; i<10; i++) { scanf("%d",&a[i]); if(a[i]>0)s1+=a[i]; if(a[i]%2==0)s2+=a[i]; } printf("正数和=%d\n偶数和=%d\n",s1,s2); return 0; }