package _1;
public class Main {
static int ans1=0,ans2=0,ans3=0;
public static void main(String[] args) {
int [][]N=new int[][]{{2,2,0,0,0,0},
{0,0,0,0,0,0},
{0,0,2,2,0,2},
{0,0,0,0,0,0},
{0,0,0,0,2,2},
{0,0,2,0,2,0}};
for(int i=0;i<N.length;i++){
for(int j=0;j<N.length;j++){
if(j+3<N.length){
if(N[i][j]==2&&N[i][j+1]==0&&N[i][j+2]==2&&N[i][j+3]==0){
ans1++;
}
}
if(i+3<N.length){
if(N[i][j]==2&&N[i+1][j]==0&&N[i+2][j]==2&&N[i+3][j]==0){
ans2++;
}
}
if(i+3<N.length&&j+3<N.length){
if(N[i][j]==2&&N[i+1][j+1]==0&&N[i+2][j+2]==2&&N[i+3][j+3]==0){
ans3++;
}
}
// }
}
}
System.out.println(ans1+ans2+ans3);
}
}
把那个数据搞进去,有点麻烦