一下是本蒟蒻的代码
#include <iostream>
using namespace std;
int a[11][11], o[11][11], n = 1;
char c;
void t90()
{
int b[11][11];
for(int i = 1; i <= n; i ++)
for(int j = 1; j <= n; j ++)
b[j][n - i + 1] = a[i][j];
for (int i = 1; i <= n; i ++)
for (int j = 1; j <= n; j ++)
a[i][j] = b[i][j];
}
void r()
{
for(int i = 1; i <= n; i ++)
for(int j = 1; j <= n / 2; j ++)
{
int c = a[i][j];
a[i][j] = a[i][n - j + 1];
a[i][n - j + 1] = c;
}
}
void test()
{
for (int i = 1; i <= n; i ++)
for (int j = 1; j <= n; j ++)
if (a[i][j] != o[i][j])
return ;
cout << n;
exit(0);
}
int main()
{
int h;
cin >> h;
for (int i = 1; i <= h; i ++)
for (int j = 1; j <= h; j ++)
{
cin >> c;
if (c == '@')
a[i][j] = 1;
}
for (int i = 1; i <= h; i ++)
for (int j = 1; j <= h; j ++)
{
cin >> c;
if (c == '@')
o[i][j] = 1;
}
t90();
test();
n ++;
t90();
test();
n ++;
t90();
test();
n ++;
t90();
r();
test();
n ++;
t90();
test();
t90();
test();
t90();
test();
n ++;
t90();
r();
test();
cout << '7';
}