main()
{int i,s1=0,s2=0,t1=0,t2=0,n;
for(i=1;i<=10;i++)
{scanf("%d",&n);
if(n%2==0){t1++;s1+=n;}
else {t2++;s2+=n;}
printf("%d\t%d,%d\t%d",t1,s1,t2,s2);}
#incluude
void main()
{
int str[11],i,n1=0,n2=0,sun1=0,sum2=0;
for(i=1;i<=10;i++)
{
scanf("%d",&str[i]);
if(str[i]%2==0)
{
n2++;
sum2=sum2+str[i];
}
else
{
n1++;
sum1=sum1+str[i];
}
}
printf("奇数个数=%d,偶数个数=%d,奇数和=%d,偶数和=%d",&n1,&sum1,&n2,&sum2);
大概就是这样,你调试下看看。
悬赏分太低啦
#include
void mian()
{
int a,b,an[],c,d,sum-ji,sum-ou,n;
a = b = c = d = sum-ji = sum-ou = 0;
printf("enter ten numbers:\n");
for(n=0;n<10;n++)
{
scanf("%d",an[n]);
if(an[n] / 2 == 0)
{
sum-ou += an[n];
c++;
}
else
{
sum-ji += an[n];
d++;
}
}
printf("the sum-ji is %d;the odd number is %d;the sum-ou is %d;the even number is %d\n",sum-ji,sum-ou,d,c);
}