Count the Mines


This is a companion discussion topic for the original entry at https://toph.co/p/count-the-mines

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

                          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