cho em hỏi vì sao em khi khai báo
bool s[100][100] = false;
thì nó lại có lỗi:
[Error] array must be initialized with a brace-enclosed initializer
còn bỏ chữ false đi thì nó lại đúng ạ.
Mọi người giải thích cho em với ạ. Em cảm ơn nhiều 
#include <iostream>
using namespace std;
void nhapmang (int a[100][100], int &row, int &col) {
cout << "\n nhap so hang: ";
cin >> row;
cout << "\n nhap so cot: ";
cin >> col;
for (int i = 0 ; i < row;i++) {
for (int j = 0 ;j < col;j++) {
cout << "\n a["<<i<<"]["<<j<<"]= ";
cin >> a[i][j];
}
}
}
void xuatmang (int a[100][100], int row, int col) {
for (int i = 0 ; i < row;i++ ) {
for (int j = 0 ;j < col;j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
}
int main()
{
int a[100][100], row, col;
cout << "NHAP MANG A: ";
nhapmang (a,row,col);
xuatmang (a,row,col);
int max = INT_MIN;
bool s[100][100] = false;
for (int j = 0 ; j < col;j++) {
for (int i = 0 ; i < row;i++) {
while (a[i][j]>0) {
int m = a[i][j]%10;
s[m][j]= true;
a[i][j]/=10;
}
}
}
int dem[100];
for (int j = 0; j < col;j++) {
dem[j]=0;
for (int i = 0; i<=9;i++) {
if (s[i][j]) dem[j]++;
}
}
for (int i = 0 ; i< col;i++) {
if (dem[i] > max) max = dem[i];
}
for (int i = 0 ; i< col;i++) {
if (dem[i] == max) cout << "\n cot "<<i+1<<" co nhieu chu so nhat voi "<<dem[i]<<" chu so";
}
system ("pause");
return 0;
}
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?