Josif_tepe

Untitled

Mar 21st, 2026
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int oi = 0, oj = 0;
  8.     for(int i = 1; i <= 5; i++) {
  9.         for(int j = 1; j <= 5; j++) {
  10.             int x;
  11.             cin >> x;
  12.            
  13.             if(x == 1) {
  14.                 oi = i;
  15.                 oj = j;
  16.             }
  17.         }
  18.     }
  19.    
  20.     cout << abs(oi - 3) + abs(oj - 3) << endl;
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment