Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int *a = new int[8];
- int *d = new int[8];
- for (int i = 0; i < 8; ++i) {
- cin >> a[i];
- }
- int num = 0;
- for (int i = 0; i < 8; ++i) {
- if (a[i] < 0) {
- d[num++] = a[i];
- }
- }
- for (int i = 0; i < 8; ++i) {
- if (a[i] > 0) {
- d[num++] = a[i];
- }
- }
- for (int i = 0; i < 8; ++i) {
- cout << d[i] << " ";
- }
- delete [] a;
- delete [] d;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement