0
已解决
于熠晨
中级守护
中级守护
题目链接: 酷町堂:1476
#include<bits/stdc++.h>
using namespace std;
int a[10005],n,cnt;
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
if(a[i]%2==0){
cnt++;
}
}
sort(a+1,a+n+1);
if(cnt==0){
for(int i=1;i<=n;i++){
if(a[i]%2==1){
cout<<a[i]<<" ";
}
}
cout<<endl;
for(int i=1;i<=n;i++){
if(a[i]%2==1){
cout<<a[i]<<" ";
}
}
}else{
for(int i=1;i<=n;i++){
cout<<a[i]<<" ";
}
}
return 0;
}
找错,各位大佬快显灵!