Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a[5], b[5], c[5], d[5], e[5], cnt, r = 3, res;
- ////////////////////////////
- int main() //
- {
- for(int y = 0; y < 5; y++) {
- cin >> a[y];
- cnt++;
- if(a[y] == 1)
- if(cnt <= 3 ) res = r - cnt;
- else res = cnt - r;
- }
- cnt = 0;
- for(int y = 0; y < 5; y++)
- {
- cin >> b[y];
- cnt++;
- if(b[y] == 1)
- if(cnt <= 3 ) res = r - cnt;
- else res = cnt - r;
- }
- cnt = 0;
- for(int y = 0; y < 5; y++)
- {
- cin >> c[y];
- cnt++;
- if(c[y] == 1)
- if(cnt <= 3 ) res = r - cnt;
- else res = cnt - r;
- }
- cnt = 0;
- for(int y = 0; y < 5; y++)
- {
- cin >> d[y];
- cnt++;
- if(d[y] == 1)
- if(cnt <= 3 ) res = r - cnt;
- else res = cnt - r;
- }
- cnt = 0;
- for(int y = 0; y < 5; y++)
- {
- cin >> e[y];
- cnt++;
- if(e[y] == 1)
- if(cnt <= 3 ) res = r - cnt;
- else res = cnt - r;
- }
- cout << res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement