We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7aabd63 commit 6b437fdCopy full SHA for 6b437fd
263A.cpp
@@ -0,0 +1,25 @@
1
+#include<iostream>
2
+using namespace std;
3
+
4
+int absol(int m){
5
+ if(m >= 0){
6
+ return m;
7
+ }
8
+ return (m * -1);
9
+}
10
11
+int main(){
12
+ int arr[5][5];
13
+ int m, n;
14
+ for(int i = 0; i < 5; i++){
15
+ for(int j = 0; j < 5; j++){
16
+ cin>>arr[i][j];
17
+ if(arr[i][j] == 1){
18
+ m = i; n = j;
19
20
21
22
+ int path = absol(m - 2) + absol(n - 2);
23
+ cout<<path;
24
+ return 0;
25
0 commit comments