#include <iostream>
using namespace std;
int main()
{
int a[10];
int b[10];
int m=0,n=0,i,j;
int temp;
//这里把输入的数字按奇偶存入两个数组
cout<<"请输入所需的10个数字";
for(i=0;i<10;i++)
{
cout<<"输入第"<<i+1<<"个数字" ;
cin>> temp;
if(temp%2==0){
a[m]=temp;
m++;
}
else{
b[n]=temp;
n++;
}
}
//现在a调整输出顺序;
for(i=0;i<m;i++)
{
for(j=0;j<m-i;j++){
if(a[j]>a[j+1])
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
//调整b的顺序;
for(i=0;i<n;i++)
{
for(j=0;j<n-i;j++)
if(a[j]>a[j+1])
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
//现在开始输出;
for(i=0;i<m;i++){
cout<<b[i];
}
cout<<endl;
for(j=0;j<n;j++){
cout<<a[j];
}
return 0;
}