diff options
Diffstat (limited to '263A/main.cpp')
| -rw-r--r-- | 263A/main.cpp | 30 |
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; +} |
