rt
#include<bits/stdc++.h>
using namespace std;
char a[15][15];
char s[15][15];
char b[15][15];
int n;
int ans=0;
int sum;
bool work()
{
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
if(s[i][j]!=b[i][j])
return false;
}
}
return true;
}
bool work1()
{
int t=n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
s[j][t]=a[i][j];
}
t--;
}
if(work())
return true;
return false;
}
bool work2()
{
int t=n;
for(int i=1;i<=n;i++)
{
int q=n;
for(int j=1;j<=n;j++)
{
s[t][q]=a[i][j];
q--;
}
t--;
}
if(work())
return true;
return false;
}
bool work3()
{
int t=1;
for(int i=1;i<=n;i++)
{
int q=n;
for(int j=1;j<=n;j++)
{
s[q][t]=a[i][j];
q--;
}
t++;
}
if(work())
return true;
return false;
}
bool work4()
{
int t=1;
for(int i=1;i<=n;i++)
{
int q=n;
for(int j=1;j<=n;j++)
{
s[t][q]=a[i][j];
q--;
}
t++;
}
if(work())
return true;
return false;
}
bool work5()
{
work4();
if(work1()||work3()||work2())
return true;
return false;
}
int main()
{
cin >> n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
cin >> a[i][j];
s[i][j]=a[i][j];
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
cin >> b[i][j];
}
}
if(work())
{
cout << 6;
return 0;
}
if(work1())
{
cout << 1;
return 0;
}
if(work2())
{
cout << 2;
return 0;
}
if(work3())
{
cout << 3;
return 0;
}
if(work4())
{
cout << 4;
return 0;
}
if(work5())
{
cout << 5;
return 0;
}
else
cout << 7;
return 0;
}
5
-@@@-
-@@--
-@---
-----
-----
-----
----@
---@@
--@@@
-----
# 为什么输出是5?我的代码输出是7