Promi_38

cf 263A

Dec 21st, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. int main()
  4. {
  5.     int x,i,j;
  6.     for(i=0;i<5;i++)
  7.     {
  8.         for(j=0;j<5;j++)
  9.         {
  10.             scanf("%d",&x);
  11.             if(x==1) printf("%d\n",abs(i-2)+abs(j-2));
  12.         }
  13.     }
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment