Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int N = 4;
- const int M = 11;
- int main() {
- int arr[M][N]{
- {8, 7, 5, 0},
- {1, 3, 2, -6},
- {1, 32, 2, 0},
- {7, 0, 3, 9},
- {0, 3, 3, -27},
- {1, 3, 2, 1},
- {-7, -1, 4, -7},
- {0, 3, 0, 83},
- {1, 1, 32, 1},
- {4, 4, 4, 4},
- {0, 3, 1, 0}
- };
- int x0 = 0;
- int x_plas = 0;
- int x_min = 0;
- for (int i = 0; i < M; ++i) {
- if (arr[M][i] == 0) {
- x0++;
- } else if (arr[M][i] > 0) {
- x_plas++;
- } else {
- x_min++;
- }
- }
- cout << endl;
- cout << "0: ";
- cout << x0;
- cout << endl;
- cout << "+: ";
- cout << x_plas;
- cout << endl;
- cout << "-: ";
- cout << x_min;
- }
Advertisement
Add Comment
Please, Sign In to add comment