Dòng 41 vì sao nó bảo là
[Error] cannot convert 'int (*)[101]' to 'int (*)[100]' for argument '1' to 'int maxcot(int (*)[100], int, int)'
và nó cx kêu lỗi tương tự với max dòng ạ
if (a[i][j]==maxcot(a,j,row)&& a[i][j]==maxdong(a,i,col)) cout << a[i][j] << " ";
#include <iostream>
using namespace std;
int maxcot (int a[][100], int j, int row) {
int maxcot1= a[0][j];
for (int i = 0; i < row; i++) {
if (a[i][j]<maxcot1) maxcot1 = a[i][j];
}
return maxcot1;
}
int maxdong (int a[][100], int i, int col) {
int maxdong1 = a[i][0];
for (int j = 0 ; j < col;j++)
{
if (a[i][j]<maxdong1) maxdong1 = a[i][j];
}
return maxdong1;
}
int maxduongcheo () {
}
int main () {
int row,col;
int a[101][101];
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];
}
}
for ( int i = 0; i<row;i++) {
for ( int j = 0; j<col; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
for (int i = 0 ; i < row; i++) {
for (int j = 0 ; j < col;j++) {
if (a[i][j]==maxcot(a,j,row)&& a[i][j]==maxdong(a,i,col)) cout << a[i][j] << " ";
}
}
return 0;
}