mọi người cho mình hỏi cái hàm bool ktradothihoplehay_ko(string s) sao nó bị lỗi hoài vậy
#include <iostream>
#include <fstream>
#define max 100
using namespace std;
int n;
int a[max][max];
void ghifile(string s);
void docfile(string s);
bool ktradothihoplehay_ko(string s);
int main()
{
int chon=1;
string s="E:\\dl.txt";
while (chon!=0)
{
cout<<" menu "<<endl;
cout<<" 1. ghi file vao tep "<<endl;
cout<<" 2. doc file"<<endl;
cout<<" 3.kiem tra do thi co hop le ko"<<endl;
cout<<" 0. thoat"<<endl;
cout<<" bam chon";
cin>>chon;
if(chon==1)ghifile(s);
if(chon==2) docfile(s);
if(chon==3)ktradothihoplehay_ko(s);
}
}
void ghifile(string s)
{
int n, a[max][max];
ofstream matran (s,ios :: out) ;
cin>>n;
matran<<n<<endl;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cin>>a[i][j];
matran<<a[i][j]<<" ";
}
matran<<"\n";
}
matran.close();
}
void docfile(string s)
{
int n, a[max][max];
ifstream nhuy (s,ios :: in);
if(nhuy.fail()){
cout << "Kiem tra lai file dau vao!";
system("pause");
}
nhuy >> n;
for (int i = 0; i < n; i ++)
{
for (int j = 0; j < n; j ++)
{
nhuy>> a[i][j];
cout << a[i][j] << " ";
}
cout << endl;
}
nhuy.close();
}
bool ktradothihoplehay_ko(string s)
{
for(int i=0;i<n;i++)
if(a[i][i]!=0)
return 1;
else
return 0;
}