summaryrefslogtreecommitdiff
path: root/263A/main.cpp
diff options
context:
space:
mode:
authormjkwiatkowski <mati.rewa@gmail.com>2026-06-01 14:34:18 +0200
committermjkwiatkowski <mati.rewa@gmail.com>2026-06-01 14:34:18 +0200
commit7172d4f401f22192abc1e116a9a88c5078eb082f (patch)
tree65b099c01ddea514a99ad68bd6306fed1a6f8b67 /263A/main.cpp
initial commitHEADmaster
Diffstat (limited to '263A/main.cpp')
-rw-r--r--263A/main.cpp30
1 files changed, 30 insertions, 0 deletions
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;
+}