Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
  string str;
  string str1;
  string str2;
  int i;
  cin >> str;
  size_t size = str.length();
  for(i = 0;i < size + 1;i++){
    str1 = str.at(2i);
    str2 = str.at(2i+1);
  }
  for(int i = 0;i < size + 1;i++){
    if(str1.at(i) == "L")
      cout << "No" << endl;
    else if(str2.at(i) == "R")
      cout << "No" << endl;
    else;
      cout << "Yes" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: no matching function for call to 'std::__cxx11::basic_string<char>::at(__complex__ int)'
   13 |     str1 = str.at(2i);
      |            ~~~~~~^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
 1287 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1287:20: note:   no known conversion for argument 1 from '__complex__ int' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 1287 |       at(size_type __n) const
      |          ~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
 1309 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1309:20: note:   no known conversion for argument 1 from '__complex__ int' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 1309 |       at(size_type __n)
      |          ~~~~~~~~~~^~~
a.cc:14:18: error: no matching function for call to 'std::__cxx11::basic_string<char>::at(__complex__ int)'
   14 |     str2 = str.at(2i+1);
      |            ~~~~~~^~~~~~
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
 1287 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1287:20: note:   no known conversion for argument 1 from '__complex__ int' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 1287 |       at(size_type __n) const
      |          ~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
 1309 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1309:20: note:   no known conversion for argument 1 from '__complex__ int' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 1309 |       at(size_type __n)
      |          ~~~~~~~~~~^~~
a.cc:17:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     if(str1.at(i) == "L")
      |        ~~~~~~~~~~~^~~~~~
a.cc:19:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |     else if(str2.at(i) == "R")
      |             ~~~~~~~~~~~^~~~~~