我不会做
请您教
下面的不对
#include <bits/stdc++.h>
using namespace std;
int lookfor(int m, int n, int *l_width, int *w_width)
{
int num = m*n;
int a[100]={-1},i=0,bo=0;
for(int j=0; j<m*n; j++)
{
for(int p=0;p<i;p++)
{
if(j == a[p])
{
bo++;
}
}
if(bo == 0)
{
for(int k=j+1; k<m*n; k++)
{
if((w_width[k/m] == l_width[j%m] && l_width[k%m] == w_width[j/m])
|| (w_width[k/m] == w_width[j/m] && l_width[k%m] == l_width[j%m]))
{
num--;
a[i++]=k;
}
}
}
bo = 0;
}
return num;
}
int main(void)
{
int m,n,num = 0;
int l_width[100],w_width[100];
cin>>m>>n;
num = m*n;
for(int i=0; i<m; i++)
cin>>l_width[i];
for(int i=0; i<n; i++)
cin>>w_width[i];
num = lookfor(m,n,l_width,w_width);
cout<<num<<endl;
getchar();
getchar();
}