Saleh127

Untitled

Apr 17th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. long long int a[200000],b,c=0,d=0,e,f,i,j,k,l;
  6. cin>>b;
  7. for(i=0; i<b; i++)
  8. {
  9. cin>>a[i];
  10. if(a[i]%2) c++;
  11. else d++;
  12. }
  13. if(c>0 && d>0) sort(a,a+b);
  14. for(k=0; k<b; k++)
  15. {
  16. if(k==b-1) printf("%d\n",a[k]);
  17. else printf("%d ",a[k]);
  18. }
  19. return 0;
  20. }
Add Comment
Please, Sign In to add comment