字符框

include<stdio.h>

int main()
{
int n,m;
scanf("%d%d",&n,&m);
char ch[n][m];
getchar();
for(int i=0;i<n;i++)
{for(int j=0;j<m;j++)
{scanf("%c",&ch[i][j]);}
getchar();}
int sum=0;
for(int i=0;i<n-1;i++)
{for(int j=0;j<m-1;j++)
{
if(ch[i][j]!='f'&&ch[i][j+1]!='f'&&ch[i+1][j]!='f'&&ch[i+1][j+1]!='f')
{continue;}
else{if(ch[i][j]!='a'&&ch[i][j+1]!='a'&&ch[i+1][j]!='a'&&ch[i+1][j+1]!='a')
{continue;}
else{if(ch[i][j]!='c'&&ch[i][j+1]!='c'&&ch[i+1][j]!='c'&&ch[i+1][j+1]!='c')
{continue;}
else{if(ch[i][j]!='e'&&ch[i][j+1]!='e'&&ch[i+1][j]!='e'&&ch[i+1][j+1]!='e')
{continue;}
else
{sum++;}
}}}
}}
printf("%d",sum);}

全部评论

相关推荐

Java抽象带篮子:难蚌,点进图片上面就是我的大头😆
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务