算出数值为 \(1\) 的点离 \((3, 3)\) 的距离即可。
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
int px = -1, py = -1;
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= 5; j++) {
int x;
cin >> x;
if (x) px = i, py = j;
}
}
cout << abs(px - 3) + abs(py - 3) << '\n';
return 0;
}
标签:include,int,题解,px,py,4797,AcWing
From: https://www.cnblogs.com/Yuan-Jiawei/p/17592301.html