#include<iostream>
using namespace std;
int main()
{
int a[10],b[10],c[10],m=0,n=0,k=0,j=0,i;
cout<<"请输入10个数:";
for(i=0;i<=9;i++)
{
cin>>a[i];
if(a[i]%2!=0)
b[m++]=a[i],k++;
else
c[n++]=a[i],j++;
}
if(k>0)
{
cout<<"奇数组:"<<endl;
for(m=0;m<k;m++)
cout<<b[m]<<" "<<endl;
}
else cout<<"该组数中没有奇数"<<endl;
if(j>0)
{
cout<<"偶数组:"<<endl;
for(n=0;n<j;n++)
cout<<c[n]<<" "<<endl;
}
else cout<<"该组数中没有奇数"<<endl;
return 0;
}
using namespace std;
int main()
{
int a[10],b[10],c[10],m=0,n=0,k=0,j=0,i;
cout<<"请输入10个数:";
for(i=0;i<=9;i++)
{
cin>>a[i];
if(a[i]%2!=0)
b[m++]=a[i],k++;
else
c[n++]=a[i],j++;
}
if(k>0)
{
cout<<"奇数组:"<<endl;
for(m=0;m<k;m++)
cout<<b[m]<<" "<<endl;
}
else cout<<"该组数中没有奇数"<<endl;
if(j>0)
{
cout<<"偶数组:"<<endl;
for(n=0;n<j;n++)
cout<<c[n]<<" "<<endl;
}
else cout<<"该组数中没有奇数"<<endl;
return 0;
}