fork download
  1. #include <cmath>
  2. #include <stdio.h>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int che[100], R;
  9. cin >> R;
  10. for (int l = 0; R > l; l++)
  11. cin >> che[l];
  12. for (int l = 0; R > l; l++)
  13. {
  14. if (che[l] % 2 != 0)
  15.  
  16. printf("%d ", che[l]);
  17.  
  18. }
  19. printf("\n");
  20. for (int l = 0; R > l; l++)
  21. {
  22. if (che[l] % 2 == 0)
  23. {
  24. printf("%d ", che[l]);
  25. }
  26. }
  27.  
  28. printf("");
  29.  
  30.  
  31. return 0;
  32. }
  33.  
  34.  
Success #stdin #stdout 0s 16048KB
stdin
10
3 5 3 2 3 5 6 7 6 5
stdout
3 5 3 3 5 7 5 
2 6 6