SHARE
TWEET

Untitled

a guest Jun 3rd, 2019 1,368 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4. bool ex[2];
  5. int arr[100005];
  6. int main()
  7. {
  8.     int n;
  9.     scanf("%d",&n);
  10.     for (int i=0;i<n;i++)
  11.     {
  12.         scanf("%d",&arr[i]);
  13.         ex[arr[i]%2]=1;
  14.     }
  15.     if (ex[0] && ex[1])
  16.     sort(arr,arr+n);
  17.     for (int i=0;i<n;i++)
  18.     printf("%d ",arr[i]);
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top