void fun(int num[],int len)
{
int odd=0,s=0,n;
for(n=0;n<len;n++)
{
odd+=(num[n]*(num[n]%2));
s+=num[n];
}
printf("the sum of all the odd number is %d\n
the sum of all the even mumber is %d\n",odd,s-odd);
}
/*说明:odd表示奇数和,S表示数组总和,len为数组长
参考资料:如果您的回答是从其他地方引用,请表明出处