#include int main(void){ int arr[6]={}; int num=0,sum=0; int i=0; while(i<6){ scanf("%d",&arr[i]); if(arr[i]%2==0){ num++; sum+=arr[i]; } i++; } printf("偶数个数:%d\n",num); printf("偶数和:%d\n",sum);}
输出结果:
0123567偶数个数:3偶数和:8有问题请追问