Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- using namespace std;
- void main()
- {
- srand(time(NULL));
- const int N = 5, M = 4;
- int arr[N][N], num[M];
- for (int i = 0; i < N; ++i)
- {
- for (int j = 0; j < M; ++j)
- {
- arr[i][j] = rand() % 21 - 3;
- cout << arr[i][j] << " ";
- }
- cout << endl;
- }
- cout << endl;
- for (int i = 0; i < N; ++i)
- {
- for (int j = 0; j < M; ++j)
- {
- if (arr[i][j] < 0)
- {
- num[j] = j;
- cout << "Stolb minus = " << j << endl;
- }
- }
- }
- for (int j = 0; j < M; ++j)
- {
- if (num[j] >= 0)
- cout << num[j] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement