#include
#include
using namespace std;
int search(int a[][100],int n,int m,int x)
{
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
if(a[i][j]==x)
{
cout<<“1”<<endl;
return 0;
}
}
}
cout<<“0”;
return 0;
}
int main()
{
int a[100][100];
int n;
int m;
cin>>n>>m;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
cin>>a[i][j];
}
}
sort(a,a+n);
int x;
cin>>x;
search(a,n,m,x);
return 0;
}
when i am using sort function in this code it is not working.if i remove sort function then it is working properly why so???