-
Notifications
You must be signed in to change notification settings - Fork 0
/
P1205.cpp
87 lines (86 loc) · 1.79 KB
/
P1205.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include <bits/stdc++.h>
using namespace std;
char a[11][11];
char b[11][11];
int way[10];
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cin >> a[i][j];
}
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cin >> b[i][j];
}
} // 输入数据
// 遍历搜索转换方法
// 转90度
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (b[i][j] != a[n - 1 - j][i]) // 转90度就是列变成行,列=n-1-行
{
way[1] = 1; // 标记此方法不能用
}
if (b[i][j] != a[n - 1 - i][n-1-j])
{
way[2] = 1;
}
if (b[i][j] != a[j][n-1-i])
{
way[3] = 1;
}
if (b[i][j] != a[i][n - 1 - j])
{
way[4] = 1;
}
if (
b[i][j] != a[j][i])
{
way[5] = 1;
}
if (b[i][j] != a[n - 1 - i][j])
{
way[6] = 1;
}
if (b[i][j] != a[n - 1 - j][n-1-i])
{
way[7] = 1;
}
if (b[i][j] != a[i][j])
{
way[8] = 1;
}
}
}
for (int i = 1; i <= 8; i++)
{
if (way[i] == 0)
{
if (i <= 4)
{
cout << i;
}
else if (i == 5 || i == 6 || i == 7)
{
cout << 5;
}
else if (i == 8)
{
cout << 6;
}
return 0;
}
}
cout << 7;
return 0;
}