J reached safely or not giving wrong ans error

can anyone tell why is my code wrong

#include
#include<bits/stdc++.h>
using namespace std;
main()
{
int t,k=1;
cin>>t;
while(t–)
{
int i,x=0,y=0,m,n;
int l,rx,ry;
cin>>m>>n>>rx>>ry;
cin>>l;
cin.ignore();
char str[l];
for(i=0;i<l;i++)
cin>>str[i];
for(i=0;i<l;i++)
{
if(str[i]==‘U’)
y++;
else if(str[i]==‘D’)
y–;
else if(str[i]==‘L’)
x–;
else if(str[i]==‘R’)
x++;

    }
    if(x==m || x<0 || y<0 || y==n)
    cout<<"Case "<<k<<": DANGER"<<endl;
    else if(x==rx && y==ry)
    cout<<"Case "<<k<<": REACHED"<<endl;
    else 
    cout<<"Case "<<k<<": SOMEWHERE"<<endl; 
    k++;
}

}