Это Ваш код, только исправлен в нескольких строчках.
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| #include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main()
{ const int N =10,M=5;
int a[N][M];int min,max;
srand(time(NULL));
for(int i = 0; i <N; i++)
{ cout<<"\n";
for(int j = 0; j <M; j++)
{ a[i][j] = rand()%(10+11)-10;
cout.width(4);
cout<<a[i][j];}}
int k = 0;
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++) if (a[i][j] == 0)
{
k++;
break;
}
}
cout<<"\n";
cout << k << "col" << endl;
return 0;
} |
|