题目链接:B - TaK Code
代码:
#include<bits/stdc++.h>
using namespace std;
int n,m;
string s[100];
int main()
{
cin>>n>>m;
for(int i=0;i<n;i++)
cin>>s[i];
string T[9]=
{
"###.?????","###.?????","###.?????","....?????",
"?????????",
"?????....","?????.###","?????.###","?????.###"
};
for(int i=0;i<=n-9;i++)
for(int j=0;j<=m-9;j++)
{
bool f=1;
for(int k=0;k<9;k++)
for(int l=0;l<9;l++)
{
if(T[k][l]=='#') if(s[i+k][j+l]!='#')f=0;
if(T[k][l]=='.') if(s[i+k][j+l]!='.') f=0;
}
if(f)cout<<i+1<<' '<<j+1<<endl;
}
}