Count the Mines

There is a special robot being created by your friend that can detect hidden mines on the ground. Bu…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

/******************************************************************************

                          Online C++ Compiler.
           Code, Compile, Run and Debug C++ program online.

Write your code in this editor and press “Run” button to compile and execute it.

*******************************************************************************/

#include

using namespace std;

int main()
{

char s[4][4];
int i,j,count=0;
for(i=0;i<4;i++){
 for(j=0;j<4;j++){
    cin>>s[i][j]; 
 }
}
for(i=0;i<4;i++){
 for(j=0;j<4;j++){
    if(s[i][j]=='m'){
    count++;    
    }
 }
}
cout<<count;
return 0;

}
why it’s say wrong answer

Read input till EOF, test cases have grid < 4