Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int oi = 0, oj = 0;
- for(int i = 1; i <= 5; i++) {
- for(int j = 1; j <= 5; j++) {
- int x;
- cin >> x;
- if(x == 1) {
- oi = i;
- oj = j;
- }
- }
- }
- cout << abs(oi - 3) + abs(oj - 3) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment