14pts求助,马蜂良好
查看原帖
14pts求助,马蜂良好
1331938
kbl_sxm1696DEshen楼主2025/1/24 15:12

14pts,马蜂良好 反正至少正常人看的清楚

#include<bits/stdc++.h>
using namespace std;
char a[20][20], b[20][20], c[20][20], vis[20][20], n;
bool is_equal(){
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			if(a[i][j] != b[i][j]) return 0;
	return 1;
}
void cz(){
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			a[i][j] = b[i][j];
}
bool one(){
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			b[j][n - i + 1] = a[i][j];
	if(is_equal()) return 1;
	return 0;
}
bool two(){
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			b[n - i + 1][n - j + 1] = a[i][j];
	if(is_equal()) return 1;
	return 0;
}
bool three(){
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			b[n - j + 1][i] = a[i][j];
	if(is_equal()) return 1;
	return 0;
}
bool four(){
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			b[i][n - j + 1] = a[i][j];
	if(is_equal()) return 1;
	return 0;
}
bool five(){
	four();
	cz();
	if(one) return 1;
	cz();
	if(two) return 1;
	cz();
	if(three) return 1;
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++)
			a[i][j] = vis[i][j];
	return 0;
}
bool six(){
	if(is_equal()) return 1;
	return 0;
}
int main(){
	cin >> n;
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++) cin >> a[i][j], vis[i][j] = a[i][j];
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= n;j++) cin >> c[i][j];
	if(one()) cout << 1 << endl;
	else if(two()) cout << 2 << endl;
	else if(three()) cout << 3 << endl;
	else if(four()) cout << 4 << endl;
	else if(five()) cout << 5 << endl;
	else if(six()) cout << 6 << endl;
	else cout << 7 << endl;
	return 0;
}
2025/1/24 15:12
加载中...