Beautifull Matrix Code Forces Solution
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main(){
- int n,i,j,s=0,s1=0,l,m;
- for(i=1;i<=5;i++){
- for(j=1;j<=5;j++){
- cin>>n;
- if(n==1){
- l=i;
- m=j;
- }
- }
- }
- s=abs(3-l);
- s1=abs(3-m);
- cout<<s+s1;
- }
Input
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Output
3
Answer
3
๐๐๐๐
If you have any doutbts comment in the below๐
Comment:
Comments
Post a Comment