题目:http://codeforces.com/contest/263/problem/A
#include <iostream> #include <cmath> using namespace std; int main() { int t; int row,col; for(int i=0;i<5;i++) { for(int j=0;j<5;j++) { cin >>t; if(t==1) { row=i+1; col=j+1; } } } int ans=abs(row-3)+abs(col-3); cout << ans; return 0; }