#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int c[5][5];
for(int i=0; i<5; i++)
for(int j=0;j<5;j++)
cin>>c[i][j];
for(int i=0; i<5; i++)
for(int j=0;j<5;j++)
if(c[i][j]==1)
cout<<abs(i-2)+abs(j-2);
return 0;
}复合数组前后序号区别



京公网安备 11010502036488号