Language: C++

#include<iostream>
using namesapce std;
int main()
{
  string s;
  cin>>s;
  int i=0;
  if(s[i]=='R'&& s[i+1]=='R'&& s[i+2]=='R')
    cout<<3<<endl;
  else if((s[i]=='R' && s[i+1]!='R' && s[i+2]!='R')||(s[i]!='R' && s[i+1]=='R' && s[i+2]!='R')||(s[i]=='R' && s[i+1]!='R' &&s[i+2]=='R')||(s[i]!='R' && s[i+1]!='R' && s[i+2]=='R'))
     cout<<1<<endl;
	else if((s[i]=='R' && s[i+1]=='R' && s[i+2]!='R')||(s[i]!='R' && s[i+1]!='R' && s[i+2]=='R'))
      cout<<2<<endl;
  else
    cout<<0<<endl;
  return 0;
}
  



Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>s;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:8: error: 's' was not declared in this scope
    6 |   cin>>s;
      |        ^
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout<<3<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |     cout<<3<<endl;
      |              ^~~~
      |              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |      cout<<1<<endl;
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |      cout<<1<<endl;
      |               ^~~~
      |               std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:13:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |       cout<<2<<endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |       cout<<2<<endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     cout<<0<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |     cout<<0<<endl;
      |              ^~~~
      |              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~