Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int ma1=0;
- const int N = 5;
- int m[N] = { 2,1,3,4,32 };
- for (int i = 0;i < N;i++) {
- if (m[i]%2==1) {
- ma1++;
- }
- }
- int *m1=new int[ma1];
- int *m2 = new int[N-ma1];
- for (int i = 0;i < N;i++) {
- if (m[i] % 2 == 1) {
- m1[i] = m[i];
- cout << "[" << m1[i] << "] ";
- }
- }
- cout << endl;
- for (int i = N-1;i >= 0;i--) {
- if(m[i]%2!=1) {
- m2[i] = m[i];
- cout << "[" << m2[i] << "] ";
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement