提交时间:2024-01-13 13:47:21
运行 ID: 36409
#include<iostream> #include<algorithm> using namespace std; int mian() { int n; cin>>n; sort(a+1,a+1+n); int flag=0; for(int i=1;i<=n;i++){ if(flag==0&&a[i]%2==1){ cout<<a[i]; flag=1; } else if(a[i]%2==1&&flag==1){ cout<<","<<a[i]; } } } return 0;