Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int const m = 18;
- int const n = 36;
- int a[m][n];
- int summ;
- int c;
- int i, j;
- summ = 0;
- srand(time(0));
- for (i = 0; i < m; i++) {
- for (j = 0; j < n; j++) {
- a[i][j] = rand() % 2;
- cout << a[i][j] << "\t";
- }
- cout << endl;
- }
- for (i = 0; i < m; i++)
- {
- c = 0;
- for (j = 0; j < n; j++)
- {
- if (a[i][j] == 0) {
- c = 1;
- }
- }
- cout << endl;
- if (c == 1) {
- cout << "There are empty seats in the wagon " << i << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement