Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using std::cout;
- void sort(int array[], int nArray)
- {
- int i;
- int countChet = 0;
- int t = 0;
- for (i = 0; i < nArray; ++i)
- {
- if (array[i] % 2 == 0)
- {
- t = array[countChet];
- array[countChet] = array[i];
- array[i] = t;
- ++countChet;
- }
- }
- cout << "Your new array: ";
- for (i = 0; i < nArray; ++i)
- {
- cout << array[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement