summaryrefslogtreecommitdiff
path: root/263A
diff options
context:
space:
mode:
Diffstat (limited to '263A')
-rwxr-xr-x263A/mainbin0 -> 16328 bytes
-rw-r--r--263A/main.cpp30
2 files changed, 30 insertions, 0 deletions
diff --git a/263A/main b/263A/main
new file mode 100755
index 0000000..b0c1be3
--- /dev/null
+++ b/263A/main
Binary files differ
diff --git a/263A/main.cpp b/263A/main.cpp
new file mode 100644
index 0000000..8630ae2
--- /dev/null
+++ b/263A/main.cpp
@@ -0,0 +1,30 @@
+#include <iostream>
+#include <math.h>
+
+using namespace std;
+
+#define SZ 5
+
+// Remember: never store the matrix
+// If you have to, store it as array
+int main(void){
+ int a;
+ int b,c;
+ for(int i = 0; i < SZ; i++){
+ for(int j = 0; j < SZ; j++){
+ cin>>a;
+ if(a == 1){
+ b = i;
+ c = j;
+ goto result;
+ }
+ }
+ }
+result:
+ int rows = abs(2 - c);
+ int columns = abs(2 - b);
+ cout<<rows+columns<<endl;
+
+
+ return 0;
+}