请求大神帮忙看一下哪里错啦,我急着去上课哇。。。
#include<stdio.h>#define n 10
void main()
{
int a[n];
int i=0,s1=0,s2=0;
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
{
while(i<10)
{
{
if(a[i]%2==0) s1=s1+a[i];
else s2=s2+a[i];
}
i++;
}
printf("%d %d\n",s1,s2);
}
{
do
{
{
if(a[i]%2==0) s1=s1+a[i];
else s2=s2+a[i];
}
i++;
}while(i<=9);
printf("%d %d\n",s1,s2);
}
{
for(i=0;i<=9;i++)
{
if(a[i]%2==0) s1=s1+a[i];
else s2=s2+a[i];
}
printf("%d %d\n",s1,s2);
}
return 0;
}