fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i=0,j=0;
  6. for(int i=0;i<s.length();i++){
  7. if(s[i]=='L'){i-=1;}
  8. else if(s[i]=='R'){i+=1;}
  9. else if(s[i]=='U'){j+=1;}
  10. else{j-=1;}
  11. }
  12. if(i==0 && j==0)return true;
  13. return false;
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:6:23: error: ‘s’ was not declared in this scope
         for(int i=0;i<s.length();i++){
                       ^
stdout
Standard output is empty