#include <iostream>
using namespace std;
int main()
{
const int N=10;
int a[I],b[I],c[I],m=0,n=0,j=0;
cout<<"请输入10个数"<<endl;
for(j=0;j<I;j++)
{
cin>>a[j];
}
for(i=0;i<N;i++)
{
if(a[j]%2==0)
{
b[m]=a[j];
m++;
}
else
{
c[n]=a[j];
n++;
}
}
cout<<"偶数为:";
for(j=0;j<m;j++)
{
cout<<b[j];
}
cout<<"奇数为:";
for(j=0;j<n;j++)
{
cout<<c[j];
}
return 0;
}
c++作业5-项目1
最新推荐文章于 2023-12-29 22:29:42 发布