Can anyone help me solve the error

I tried but unable to understsnd the error in the code

send the link of code

#include<bits/stdc++.h>
#include
using namespace std;
void magical(char ar[100][100],int n,int m,int k ,int s )
{ bool success = true ;
int i ,j;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{ char ab= ar[i][j];
if(s<k)
{
break;
success =false ;
}
else if(ab== β€˜.’)
s-= 2;
else if (ab == β€˜*’)
s+=5;
else
break;
}
if(j<n-1)
s–;
}
if(success)
cout << β€œyes” ;
else
cout <<β€œno” ;

}

int main()
{
int n,m,s,k,i,j;
cin >>n>>m>>k>>s;
char arr[n][m];
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cin>>arr[i][j];
}
}
magical(arr,n,m,k,s);

return 0;

}

i have corrected the error

if ans is yes then also print the amount of strength he escaped with.

Still test cases are getting failed

have you print the amount of strength

yes
i Have printed …

you are not handling all the cases
i have modified your code
check now

Ok got the point Thanks …

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.