criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
import java.io.*;
import java.lang.*;



public class Codeforces
{
  public static void main(String[] args) {

  Scanner s=new Scanner(System.in);
  String a;
  a=s.next();
  int n=a.length();

  if(a.charAt(0)=='R' && a.charAt(1)=='R' && a.charAT(2)=='R')
  {
    System.out.print(3);
  }
  else if(a.charAt(0)=='R' && a.charAt(1)=='R' && a.charAT(2)=='S')
  {
    System.out.print(2);
  }
  else if(a.charAt(0)=='R' && a.charAt(1)=='S' && a.charAT(2)=='R')
  {
    System.out.print(2);
  }
  else if(a.charAt(0)=='S' && a.charAt(1)=='R' && a.charAT(2)=='R')
  {
    System.out.print(2);
  }
  else if(a.charAt(0)=='R' && a.charAt(1)=='S' && a.charAT(2)=='S')
  {
    System.out.print(1);
  }
  else if(a.charAt(0)=='S' && a.charAt(1)=='R' && a.charAT(2)=='S')
  {
    System.out.print(1);
  }
  else if(a.charAt(0)=='S' && a.charAt(1)=='S' && a.charAT(2)=='R')
  {
    System.out.print(1);
  }
  else
  {
    System.out.print(0);
  }












  }
}


Compiler output:
Main.java:7: error: class Codeforces is public, should be declared in a file named Codeforces.java
public class Codeforces
       ^
Main.java:16: error: cannot find symbol
  if(a.charAt(0)=='R' && a.charAt(1)=='R' && a.charAT(2)=='R')
                                              ^
  symbol:   method charAT(int)
  location: variable a of type String
Main.java:20: error: cannot find symbol
  else if(a.charAt(0)=='R' && a.charAt(1)=='R' && a.charAT(2)=='S')
                                                   ^
  symbol:   method charAT(int)
  location: variable a of type String
Main.java:24: error: cannot find symbol
  else if(a.charAt(0)=='R' && a.charAt(1)=='S' && a.charAT(2)=='R')
                                                   ^
  symbol:   method charAT(int)
  location: variable a of type String
Main.java:28: error: cannot find symbol
  else if(a.charAt(0)=='S' && a.charAt(1)=='R' && a.charAT(2)=='R')
                                                   ^
  symbol:   method charAT(int)
  location: variable a of type String
Main.java:32: error: cannot find symbol
  else if(a.charAt(0)=='R' && a.charAt(1)=='S' && a.charAT(2)=='S')
                                                   ^
  symbol:   method charAT(int)
  location: variable a of type String
Main.java:36: error: cannot find symbol
  else if(a.charAt(0)=='S' && a.charAt(1)=='R' && a.charAT(2)=='S')
                                                   ^
  symbol:   method charAT(int)
  location: variable a of type String
Main.java:40: error: cannot find symbol
  else if(a.charAt(0)=='S' && a.charAt(1)=='S' && a.charAT(2)=='R')
                                                   ^
  symbol:   method charAT(int)
  location: variable a of type String
8 errors
Language: C

#include <stdio.h>
int main(void){
  char str[3];
  int sum=0;
  int i;
  for (i=1; i<=3; i++){
  scanf ("%s", &str[i]);
    if (str[1]=='R'&&str[2]='R')
      sum=2;
    if (str[2]=='R'&&str[3]='R')
      sum=2;
    if (str[1]=='R'&&str[3]='R')
      sum=1;
    else
      sum=0;
  }
  printf("%d", sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:28: error: lvalue required as left operand of assignment
    8 |     if (str[1]=='R'&&str[2]='R')
      |                            ^
main.c:10:28: error: lvalue required as left operand of assignment
   10 |     if (str[2]=='R'&&str[3]='R')
      |                            ^
main.c:12:28: error: lvalue required as left operand of assignment
   12 |     if (str[1]=='R'&&str[3]='R')
      |                            ^
Language: C++

S = input()

if "RRR" in S:
    print(3)
elif "RR" in S:
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)


Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int cnt=0;
  string s; cin >> s;
  if(s[0]=='R'){
    cnt++;
    if(s[1]=='R'){
      cnt++;
      if(s[2]=='R'){
        cnt++;
      }
    }else {
    	if(s[2]=='R'){
        cnt++;
    }
  }else{
    if(s[1]=='R'){
      cnt++;
      if(s[2]=='R'){
        cnt++;
      }
    }else{
    	if(s[2]=='R'){
        cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:4: error: expected '}' before 'else'
   18 |   }else{
      |    ^~~~
a.cc:7:16: note: to match this '{'
    7 |   if(s[0]=='R'){
      |                ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;

  if (S[0] == 'R' && S[0] == S[1] && S[1] == S[2]){
      cout << 3 <<endl;
  }else if (S[0] == S[1] && S[0] == 'R' ){
      cout << 2 <<endl;
  }else if (S[1] == S[2] && S[1] == 'R' ){
      cout << 2 <<endl;
  }else if (S[0] == 'R' || S[1] == 'R' || S[2] == 'R'){
      cout << 1 <<endl;
  }else{
      cout << 0 <<endl;
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
    cout << RRS << endl;

    return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'RRS' was not declared in this scope
    8 |     cout << RRS << endl;
      |             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;

  if (S[0] == 'R' && S[0] == S[1] && S[1] == S[2]){
      cout << 3 <<endl;
  }else if (S[0] == S[1] && S[0] == "R" ){
      cout << 2 <<endl;
  }else if (S[1] == S[2] && S[1] == "R" ){
      cout << 2 <<endl;
  }else if (S[0] == "R" || S[1] == "R" || S[2] == "R"){
      cout << 1 <<endl;
  }else{
      cout << 0 <<endl;
  }
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   }else if (S[0] == S[1] && S[0] == "R" ){
a.cc:12:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   }else if (S[1] == S[2] && S[1] == "R" ){
a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   }else if (S[0] == "R" || S[1] == "R" || S[2] == "R"){
a.cc:14:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   }else if (S[0] == "R" || S[1] == "R" || S[2] == "R"){
a.cc:14:48: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   }else if (S[0] == "R" || S[1] == "R" || S[2] == "R"){
Language: C++

#include <bits/stdc++.h> #include <vector> #include<queue> #include<stack> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define gogogo ios::sync_with_stdio(0);cin.tie(0); int build(){ } int solve(){ string s1; cin>>s1; int cnt=0,ans=1; for(int i=0;i<3;i++){ if(s[i]=='R')cnt++; ans=max(ans,cnt); } return(ans); } } int main(){ gogogo; int t=1; // cin>>t; 
while(t--){ auto c=solve(); cout<<c<<endl; } }

Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> #include <vector> #include<queue> #include<stack> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define gogogo ios::sync_with_stdio(0);cin.tie(0); int build(){ } int solve(){ string s1; cin>>s1; int cnt=0,ans=1; for(int i=0;i<3;i++){ if(s[i]=='R')cnt++; ans=max(ans,cnt); } return(ans); } } int main(){ gogogo; int t=1; // cin>>t;
      |                          ^
a.cc:2:1: error: expected unqualified-id before 'while'
    2 | while(t--){ auto c=solve(); cout<<c<<endl; } }
      | ^~~~~
a.cc:2:46: error: expected declaration before '}' token
    2 | while(t--){ auto c=solve(); cout<<c<<endl; } }
      |                                              ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
  string str1;
  cin >> str1;
  int num = 0;
  for (int i = 0; i < 3; ++i){
    if(str1[0] == "R"){
      if(num == 1){
        if(num==2){
          num == num +1;
        }
      }
      else{
        num = num +1;
      }
    }
    else{
      num = 1;
    }
    
    
  }
  cout << num << endl;
  
  return 0;
  
  
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if(str1[0] == "R"){
Language: C++


#include <iostream>

using namespace std;

int main()
{
    string s;
    cin>>s;
    count=0;
    for(int i=0;i<3;i++)
    {
        if(s[i]=='R')
           {
          count++;
            if(s[i+1]=='R'
               count++;
            else
               continue;
           }
         else  {
                 if(s[i]=='R'
                    count++;
                 if(s[i+1]=='R'
                    count++;
                    }    
            
    }
    cout<<count<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'count' was not declared in this scope
   10 |     count=0;
      |     ^~~~~
a.cc:16:27: error: expected ';' before 'count'
   16 |             if(s[i+1]=='R'
      |                           ^
      |                           ;
   17 |                count++;
      |                ~~~~~       
a.cc:18:13: error: expected primary-expression before 'else'
   18 |             else
      |             ^~~~
a.cc:17:24: error: expected ')' before 'else'
   17 |                count++;
      |                        ^
      |                        )
   18 |             else
      |             ~~~~        
a.cc:16:15: note: to match this '('
   16 |             if(s[i+1]=='R'
      |               ^
a.cc:22:30: error: expected ';' before 'count'
   22 |                  if(s[i]=='R'
      |                              ^
      |                              ;
   23 |                     count++;
      |                     ~~~~~     
a.cc:24:18: error: expected primary-expression before 'if'
   24 |                  if(s[i+1]=='R'
      |                  ^~
a.cc:23:29: error: expected ')' before 'if'
   23 |                     count++;
      |                             ^
      |                             )
   24 |                  if(s[i+1]=='R'
      |                  ~~          
a.cc:22:20: note: to match this '('
   22 |                  if(s[i]=='R'
      |                    ^
Language: C++

#include <iostream>
using namespace std;

int main () {
  
  string S;
  cin S;
  
  if (S == "RRR") {
    cout << 3 << endl;
  }
  
  if (S == "RRS" || S == "SRR") {
    cout << 2 << endl;
  }
  
  if (S == "RSS" || S == "SRS" || S == "SSR" || S == "RSR") {
    cout << 1 << endl;
  }
  
  else {
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'S'
    7 |   cin S;
      |      ^~
      |      ;
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;


int main() {
  string str1;
  cin >> str1;
  int num = 0;
  for (int i = 0; i < 3; ++i){
    if(str1[0] == "R"){
      if(num == 1){
        if(num==2){
          num == num +1
        }
      }
      else{
        num = num +1
      }
    }
    else{
      num = 1
    }
    
    
  }
  cout << num << endl;
  
  return 0;
  
  
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if(str1[0] == "R"){
a.cc:16:24: error: expected ';' before '}' token
   16 |           num == num +1
      |                        ^
      |                        ;
   17 |         }
      |         ~               
a.cc:20:21: error: expected ';' before '}' token
   20 |         num = num +1
      |                     ^
      |                     ;
   21 |       }
      |       ~              
a.cc:24:14: error: expected ';' before '}' token
   24 |       num = 1
      |              ^
      |              ;
   25 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
#define ll long long
#define trace(x) cerr << #x << " = " << x << endl
using namespace std;

/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
*/
int main()
{
   /*
    #ifndef ONLINE_JUDGE
      freopen("input.txt","r",stdin);
      freopen("ouput.txt","w",stdout);
    #endif 
   */

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1; 
    while(t--){
         string s;
	 cin>>s;
	 int count = 0;
	 int ans = 0;
	 for(int i =0; i <(int)s.size(); i++){
		 if(s[i] == 'R'){
			 count++;
		 }
		 else{
			count = 0;
                        flag = 1;
		 }
                 ans = max(ans, count);
	}
	cout<<ans<<endl;
    }
    return 0;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:38:25: error: 'flag' was not declared in this scope
   38 |                         flag = 1;
      |                         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;int cnt=0;
  cin>>s;
  for(int i=0;i<str.length();i++)
  {
    if(str[i]!=str[i+1])
    {
      cnt++;
    }
  }
  cout<<(cnt+1)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |   for(int i=0;i<str.length();i++)
      |                 ^~~
      |                 std
Language: C++

#include<stdio.h>
#include<string.h>

int main()

{
    char S[3];

    int len,i,cnt = 0;

    gets(S);

    len = strlen(S);

    for(i=0;i<len;i++)
    {
        if(S[i]=='R')
        {
            cnt++;
        }

        if(S[i]=='S')
        {
            break;
        }
    }

    printf("%d",cnt);


}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |     gets(S);
      |     ^~~~
      |     getw
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{   int c = 0;
    string s;
    cin >> s;
    for (int i = 1; i < s.size(), ++i)
       {
            if (s[i-1] == s[i])
            c = i + 1;
       }
    cout << c;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:9:38: error: expected ';' before ')' token
    9 |     for (int i = 1; i < s.size(), ++i)
      |                                      ^
      |                                      ;
Language: C++

#inclue<bits/stdc++.h>
using namespace std;

int main(){
  int cnt=0;
  string s; cin >> s;
  if(s[0]=='R'){
    cnt++;
    if(s[1]=='R'){
      cnt++;
      if(s[2]=='R'){
        cnt++;
      }
    }
  }else{
    if(s[1]=='R'){
      cnt++;
      if(s[2]=='R'){
        cnt++;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s; cin >> s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #inclue<bits/stdc++.h>
a.cc:6:13: error: 'cin' was not declared in this scope
    6 |   string s; cin >> s;
      |             ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclue<bits/stdc++.h>
a.cc:6:20: error: 's' was not declared in this scope
    6 |   string s; cin >> s;
      |                    ^
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout << cnt << endl;
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:18: error: 'endl' was not declared in this scope
   23 |   cout << cnt << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclue<bits/stdc++.h>
Language: C

#include <stdio.h>
#include <stdlib.h>

int main( int argc, char *argv[] )
{
    char s[4];

    scanf( "%s", s );

    if( ! strcmp( s, "RRR" ) {
        puts( "3" ); exit( 0 );
    else if( ! strcmp( s, "RRS" ) {
        puts( "2" ); exit( 0 );
    else if( ! strcmp( s, "RSR" ) {
        puts( "1" ); exit( 0 );
    else if( ! strcmp( s, "RSS" ) {
        puts( "1" ); exit( 0 );
    else if( ! strcmp( s, "SSS" ) {
        puts( "0" ); exit( 0 );
    else if( ! strcmp( s, "SSR" ) {
        puts( "1" ); exit( 0 );
    else if( ! strcmp( s, "SRS" ) {
        puts( "1" ); exit( 0 );
    else if( ! strcmp( s, "SRR" ) {
        puts( "2" ); exit( 0 );
    }

    puts( "0" );
}


Compiler output:
main.c: In function 'main':
main.c:10:11: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   10 |     if( ! strcmp( s, "RRR" ) {
      |           ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:10:29: error: expected ')' before '{' token
   10 |     if( ! strcmp( s, "RRR" ) {
      |       ~                     ^~
      |                             )
main.c:29:1: error: expected declaration or statement at end of input
   29 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define endl '\n'
#define mod 1000000007
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(x) (x).begin(), (x).end()
void make_unique(vector<ll> vec)
{
sort(all(vec));
vec.resize(unique(all(vec)) - vec.begin());
}


int main() 
{   ios;
    int t=1;
    //cin>>t;
    //cin.ignore(numeric_limits<streamsize>::max(),'\n');
    while(t--)
    {ll sum=0,ans=0,x,y,k,h,a,c,n,t,m,i,j,flag=0,count=0,moves=0;
     string s;
     cin>>s;
     
     if(s=="RRS"||s=="SRR")
     cout<<2<<endl;
     else if(s=-"RSS"||s=="RSR"||s=="SRS"||s=="SSR")
     cout<<1<<endl;
     else if(s=="RRR")
     cout<<3<<endl;
     else 
     cout<<0<<endl;

     
     
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: wrong type argument to unary minus
   33 |      else if(s=-"RSS"||s=="RSR"||s=="SRS"||s=="SSR")
      |                 ^~~~~
Language: C

#include<stdio.h>

int main(){
        int count=0, i;
        char s[4];
        scanf("%s", s);
        for(i=0;i<3; i++){
                if(s[i]=='R'){
                        count++;
                }else{
                        count=0;
                }
        }
        printf("%d", count);
        return 0;
}
~


Compiler output:
main.c:17:1: error: expected identifier or '(' before '~' token
   17 | ~
      | ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>

using namespace std;
 int main(){
    string s;
   cin>>s;
   int l=0;
  l= count(s,'R');
   if(l==3)cout<<3<<endl;
   else if(l==1)cout<<1<<endl;
   else if(l==2){
     if(s[0]=='R'&&s[2]=='R')cout<<1<<endl;
     else if((s[0]=='R'&&s[1]=='R')||(s[1]=='R'&&s[2]=='R')) cout<<2<<endl; }
 else{	cout<<0<<endl;}
			
        

   
     
     return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: no matching function for call to 'count(std::string&, char)'
   11 |   l= count(s,'R');
      |      ~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{string s;
 cin>>s;
 count=0;
 for(int i=0;i<3;i++)
 if(s.at(i)=='R')
   count++;
 else count=0;
 if(s.at(2)=='S')
   if(s.at(0)=='R'&&s.at(1)=='R')
     count=2;
 	else if (s.at(0)=='R'||s.at(1)=='R')
      count=1;
 cout<<count;
 return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:2: error: 'count' was not declared in this scope
    7 |  count=0;
      |  ^~~~~
Language: C++


using namespace std;
string s; 
int main()
{
	cin>>s;
	if(s[0]=='R'&&s[1]=='R'&&s[2]=='R')cout<<3;
	else if(s[0]=='S'&&s[1]=='S'&&s[2]=='S')cout<<0;
	else if(s[1]=='S')cout<<1;
	else cout<<2;
	return 0;
}

Compiler output:
a.cc:3:1: error: 'string' does not name a type
    3 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>s;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:6:14: error: 's' was not declared in this scope
    6 |         cin>>s;
      |              ^
a.cc:7:44: error: 'cout' was not declared in this scope
    7 |         if(s[0]=='R'&&s[1]=='R'&&s[2]=='R')cout<<3;
      |                                            ^~~~
a.cc:7:44: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:49: error: 'cout' was not declared in this scope
    8 |         else if(s[0]=='S'&&s[1]=='S'&&s[2]=='S')cout<<0;
      |                                                 ^~~~
a.cc:8:49: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:27: error: 'cout' was not declared in this scope
    9 |         else if(s[1]=='S')cout<<1;
      |                           ^~~~
a.cc:9:27: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:14: error: 'cout' was not declared in this scope
   10 |         else cout<<2;
      |              ^~~~
a.cc:10:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.Scanner;

    public class Main {
    	 public static void main(String args[]){
    	Scanner scanner = new Scanner(System.in);

    	String n=scanner.nextString();
    	int t=0;
           for(i=0;i<3;i++){
        String str=n.charAt(0);
		if(str1=="R"){
            t=1;
        }}

    	for(int j=0;j<2;j++) {
      	String str1=n.charAt(j);
          String str2=n.charAt(j+1);
          
          if(str1==str2 && str1=="R"){
          t=t+1
         }
    	}
    	System.out.println(t);
    	 }
    }

Compiler output:
Main.java:20: error: ';' expected
          t=t+1
               ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  string S;
  cin >> S;
  if(S == "SSS"){
  cout << 0 <<endl;
   }  
  if(S == "SSR" || S == "SRS" || S == "RSS" || S == "RSR"){
  cout << 1 <<endl;
   }
  if(S == "SRR" || S == "RRS" || ){
  cout << 2 <<endl;
   }
  if(S == "RRR"){
  cout << 3 <<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:34: error: expected primary-expression before ')' token
   14 |   if(S == "SRR" || S == "RRS" || ){
      |                                  ^
Language: Java

import java.util.Scanner;
public class Main {
  public static void main (String[] args){
    Scanner sc = new Scanner(System.in);
    String s1;
    String s2;
    String s3;
    int counter = 0;

    s1 = sc.nextString();
    s2 = sc.nextString();
    s3 = sc.nextString();

    if (s1.equals('R')){
      counter++;
    }
    if(s2.equals('R')){
      counter++;
    }
    if (s1.equals('R')){
      counter++;
    }

    System.out.println(counter);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    s1 = sc.nextString();
           ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:11: error: cannot find symbol
    s2 = sc.nextString();
           ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:12: error: cannot find symbol
    s3 = sc.nextString();
           ^
  symbol:   method nextString()
  location: variable sc of type Scanner
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long mx(long long a,long long b){if(a>b)return a;else return b;}
long long mn(long long a,long long b){if(a<b)return a;else return b;}
long long cei(long long a,long long b){if(a%b==0)return a/b;else return (a/b+1);}
const int MOD=1e9+7;
long long po(long long a,long long b){long long res=1;while(b>0){res=(res*a);res%=MOD;b--;}return res;}


int main()
{
string s;
cin>>s;
int count=0;
int ans=0
for(int i=0;i<3;i++){
if(s[i]=='R'){count++;
ans=max(ans,count);}
else
count=0;}

cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:1: error: expected ',' or ';' before 'for'
   16 | for(int i=0;i<3;i++){
      | ^~~
a.cc:16:13: error: 'i' was not declared in this scope
   16 | for(int i=0;i<3;i++){
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
char r,t,y;
cin>>r>>t>>y;
int q=0;
if(r=="R")
{q++;
}
if(t=="R")
{q++;}
if(y=="R")
{q++;}
if(t=="S"&&q==2)
{
  cout << 1 << endl;
}
else{cout << q<< endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | if(r=="R")
      |    ~^~~~~
a.cc:11:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | if(t=="R")
      |    ~^~~~~
a.cc:13:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | if(y=="R")
      |    ~^~~~~
a.cc:15:5: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 | if(t=="S"&&q==2)
      |    ~^~~~~
Language: C++

#include<iostream>
using namespace std;
string S;
int main(){
  cin >> S;
  int count =0;
  if ((S[0]=="R") && (S[1]=="R") && (S[2]=="R")){
    count =3;
  }
  else if (((S[0]=="R") && (S[1]=="R")) || ((S[1]=="R") && (S[2]=="R"))){
    count =2;
  }
  else if ((S[0]=="R") || (S[1]=="R") || (S[2]=="R")){
    count =1;
  }
  else {
    count =0;
  }
  cout << count <<endl;
}
  

  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if ((S[0]=="R") && (S[1]=="R") && (S[2]=="R")){
a.cc:7:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if ((S[0]=="R") && (S[1]=="R") && (S[2]=="R")){
a.cc:7:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if ((S[0]=="R") && (S[1]=="R") && (S[2]=="R")){
a.cc:10:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   else if (((S[0]=="R") && (S[1]=="R")) || ((S[1]=="R") && (S[2]=="R"))){
a.cc:10:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   else if (((S[0]=="R") && (S[1]=="R")) || ((S[1]=="R") && (S[2]=="R"))){
a.cc:10:50: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   else if (((S[0]=="R") && (S[1]=="R")) || ((S[1]=="R") && (S[2]=="R"))){
a.cc:10:65: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   else if (((S[0]=="R") && (S[1]=="R")) || ((S[1]=="R") && (S[2]=="R"))){
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   else if ((S[0]=="R") || (S[1]=="R") || (S[2]=="R")){
a.cc:13:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   else if ((S[0]=="R") || (S[1]=="R") || (S[2]=="R")){
a.cc:13:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   else if ((S[0]=="R") || (S[1]=="R") || (S[2]=="R")){
Language: C++

#include<iostream>
#include<string>
#include<bits/stdc++.h>

using namespace std;
 int main(){
    string s;
   cin>>s;
   int l=0;
  l= count(s,'R');
   if(l==3)cout<<3<<endl;
   else if(l==1)cout<<1<<endl;
   else if(l==2){
     if(s[0]=='R'&&s[2]=='R')cout<<1<<endl;
     else if((s[0]=='R'&&s[1]=='R')||(s[1]=='R'&&s[2]=='R')) cout<<2<<endl; }
 else{	cout<<0<<endl;}
			
        

   
     
     return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: no matching function for call to 'count(std::string&, char)'
   10 |   l= count(s,'R');
      |      ~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
	//cin >> t;
	//while(t--) {
	s = "";
		cin >> s;
		ans = 0;
		if(s[0] == 'R' && s[1] == 'R' && s[2] == 'R'){
			cout << "3\n";
			return 0;
		} else if((s[0] == 'R' && s[1] == 'R') || (s[2] == 'R' && s[1] == 'R')){
			cout << "2\n";
			return 0;
		} else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R'){
			cout << "1\n";
			return 0;
		} else
			cout << "0\n";
	//}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |                 ans = 0;
      |                 ^~~
      |                 abs
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Test {

	public static void main(String[] args) throws IOException{
		String input = new BufferedReader(new InputStreamReader(System.in)).readLine();
		String s1 = input.substring(0,1);
		String s2 = input.substring(1,2);
		String s3 = input.substring(2,3);
		int day = 0;
		
		if(s1.equals("R")) {
			day = 1;
			if(s2.equals("R")) {
				day = 2;
				if(s3.equals("R")) {
					day = 3;
				}	
			}
		}
		else if(s2.equals("R")) {
			day = 1;
			if(s3.equals("R")) {
				day = 2;
			}	
		}
		else if(s3.equals("R")) {
			day = 1;
		}

		System.out.println(day);

	}

}

Compiler output:
Main.java:5: error: class Test is public, should be declared in a file named Test.java
public class Test {
       ^
1 error
Language: C++

/**
 * CODE
 * BY
 * VIKAS VERMA
*/
#include <bits/stdc++.h>
using namespace std;
#define fo(i, n) for (i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n; i++)

#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define PI 3.1415926535897932384626
#define endl "\n"
#define F first
#define S second
#define PB push_back
#define MP make_pair
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef long long ll;
//=======================
const int MOD = 1'000'000'007;
const int N = 2e6 + 13;
//=======================
vi g[N];
int a[N];
//=======================

void solve()
{
  string s;
  cin >> s;
  int len = s.length();
  int count = 0;
  if (s[0] == 'R')
    count++;
  int _max = 0;
  for (int i = 0; i < n - 1; i++)
  {
    if (s[i] == 'R' && s[i + 1] == 'R')
      count++;
    else
    {
      _max = max(_max, count);
    }
  }
  _max = max(_max, count);
  cout << _max << endl;
}

int main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int t = 1;

  cin >> t;

  while (t--)
  {
    solve();
  }

  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:42:23: error: 'n' was not declared in this scope
   42 |   for (int i = 0; i < n - 1; i++)
      |                       ^
Language: C

int main(void){
  int S =
  printf(%d,S)
}

Compiler output:
main.c: In function 'main':
main.c:3:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    3 |   printf(%d,S)
      |   ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    3 |   printf(%d,S)
      |   ^~~~~~
main.c:3:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:3:10: error: expected expression before '%' token
    3 |   printf(%d,S)
      |          ^
main.c:4:1: error: expected ',' or ';' before '}' token
    4 | }
      | ^
main.c:4:1: error: expected declaration or statement at end of input
Language: C++

#include<bits/c++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int count=0;
  for(int i=1;i<s.length();++i)
  {
    if(s[i]=='R')
    {
      if(count==0)
      {
        ++count;
      }
      if(s[i-1]=='R')
      {
    	++count;
      }
    }
  }
	cout<<count;
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/c++.h: No such file or directory
    1 | #include<bits/c++.h>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{

    string s;
    cin>>s;
    int c = 0, ans =-1;
    for(int i=0; i<s.size(); i++)
    {
        if(s[i]=='R')c++;
        else
        {
            ans = max(c, ans);
            c=0;
        }
    }
    cout<<ans<<endl;RSRRSR
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: 'RSRRSR' was not declared in this scope
   18 |     cout<<ans<<endl;RSRRSR
      |                     ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++);
using ll = long long;
using namespace std;

int main(){
  char s[3];
  cin >> s;
  if(s == 'RRS' || s == 'SRR'){
      cout << "2" << endl;
  } 
  else if(s == "RRR"){
      cout << "3" << endl;
  }
  else{
      cout << "0" << endl;
  }
  return 0;
}

Compiler output:
a.cc:9:11: warning: multi-character character constant [-Wmultichar]
    9 |   if(s == 'RRS' || s == 'SRR'){
      |           ^~~~~
a.cc:9:25: warning: multi-character character constant [-Wmultichar]
    9 |   if(s == 'RRS' || s == 'SRR'){
      |                         ^~~~~
a.cc: In function 'int main()':
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(s == 'RRS' || s == 'SRR'){
      |      ~~^~~~~~~~
a.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(s == 'RRS' || s == 'SRR'){
      |                    ~~^~~~~~~~
Language: C++

#include <bit/stdc++.h>
using namespace std;
string s;
int main() {
	//cin >> t;
	//while(t--) {
	s = "";
		cin >> s;
		ans = 0;
		if(s[0] == 'R' && s[1] == 'R' && s[2] == 'R'){
			cout << "3\n";
			return 0;
		} else if((s[0] == 'R' && s[1] == 'R') || (s[2] == 'R' && s[1] == 'R')){
			cout << "2\n";
			return 0;
		} else if(s[0] == 'R' || s[1] == 'R' || s[2] == 'R'){
			cout << "1\n";
			return 0;
		} else
			cout << "0\n";
	//}
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: bit/stdc++.h: No such file or directory
    1 | #include <bit/stdc++.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<numeric>
#include<cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#define ll long long int
#define CON 100010
const long long mod=1e9+7;
const int INF=1001001001;
const int inf=100000;
//const ll inf=1e9+7;
//const ll ful=1e18;
using namespace std;
//namespace mp = boost::multiprecision;

int main() 
{
	string s;
	cin>>s;
	int count=1;
	int flag=0;
	for(int i=1;i<3;i++)
	{
		if(s[i-1]=='R'&&s[i]=="R") count++;
		if(s[i-1]=='R') flag=1;
	}
	if(flag)
	{
		cout<<count<<endl;
	}
	else
	{
		cout<<0<<endl;
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |                 if(s[i-1]=='R'&&s[i]=="R") count++;
Language: C++

// AUTHOR : UTKARSH CHAUHAN 

#include<bits/stdc++.h>
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define rep(i, j, k)    for(int i = (j); i < (int)k; ++i)
#define rrep(i, k, j)   for(int i = (int)k - 1; i >= (j); --i)
#define pb              push_back
#define mp              make_pair
#define pii             pair<int, int>
#define endl            "\n"
#define vi              vector<int>
#define mii             map<int, int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int, vi, greater<int>>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x, y)        fixed << setprecision(y) << x
#define mk(arr, n, type)type *arr = new type[n];
#define w(x)            int x; cin >> x; while(x--)
#define PI              3.14159265358979323846264338327950L
#define span(a)         begin(a), end(a)
#define parent(i)       (i >> 1)
#define left(i)         (i << 1)
#define right(i)        (left(i) | 1)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());


// int gcd (int a, int b) {
//   if (b == 0) return a;
//   else return gcd (b, a % b);
// }
// int gcd(int a, int b, int& x, int& y) {
//   if (b == 0) {
//     x = 1;
//     y = 0;
//     return a;
//   }
//   int x1, y1;

//   int d = gcd(b, a % b, x1, y1);
//   x = y1;
//   y = x1 - y1 * (a / b);
//   return d;
// }
// int lcm (int a, int b)  {
//   return a / gcd(a, b) * b;
// }
// int fact (int n){
//   if (n == 0) return 1 ;
//   else return n * fact(n - 1);
// }

// bool isPrime(int x) {
//   for (int d = 2; d * d <= x; d++) if (x % d == 0) return false;
//   return true;
// }

// int divisor(int number)
// {
//         int i;
//         for (i = 2; i <= sqrt(number); i++)
//         {
//                 if (number % i == 0)
//                 {
//                        return number/i;
//                 }
//         }
//         return 1;
// }

void c_p_c()
{
      ios_base::sync_with_stdio(0);
      cin.tie(0);cout.tie(0);
}


void solve()
{
      stirng s; cin >> s;
      if (s[0] == 'R' and s[1] == 'R' and s[2] == 'R') 
      {
            cout << 3 << endl;
            return;
      }

      if ((s[0] == 'R' and s[1] == 'R') or (s[1] == 'R' and s[2] == 'R') or (s[0] == 'R' and s[2] == 'R'))
      {
            cout << 2 << endl;
            return;
      }

      if (s[0] == 'R' or s[1] == 'R' or s[2] == 'R') 
      {
            cout << 1 << endl;
            return;
      }
      
}
int32_t main()
{
     // c_p_c();
      //w(x)
      solve();
      return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:86:7: error: 'stirng' was not declared in this scope
   86 |       stirng s; cin >> s;
      |       ^~~~~~
a.cc:86:24: error: 's' was not declared in this scope
   86 |       stirng s; cin >> s;
      |                        ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  string s;
  cin>>s;
  
  int l=s.length();
  int i;
  int max=INT_MIN;
  for(i=0;i<l-1;i++)
  {
    if(s[i]=='R' && s[i+1]=='R')
      	count++;
    else
    {
      if(count > max)
      {
        max=count;
        count =0;
      }
    }
  }
  
  cout<<max;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: no post-increment operator for type
   16 |         count++;
      |              ^~
a.cc:19:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
   19 |       if(count > max)
      |          ~~~~~~^~~~~
a.cc:21:13: error: cannot resolve overloaded function 'count' based on conversion to type 'int'
   21 |         max=count;
      |             ^~~~~
a.cc:22:16: error: overloaded function with no contextual type information
   22 |         count =0;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    string s;
    cin >> s;
    
    if(s == "RRR"){
        cout << "3" << endl;
    }
    else if(s == "RRS" || s == "SRR"){
        cout << "2" << endl;
    }
  	else if(s == "SSS"){
      	cout << "0" << ensl;
    }
    else
    {
        cout << "1" << endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'ensl' was not declared in this scope
   15 |         cout << "0" << ensl;
      |                        ^~~~
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String a = sc.next();
        String b = sc.next();
        String c = sc.next();

		int n;
        n=0;
        
        if(a==R){
        	n=1;
            if(b==R){
            	n=2;
                if(n==3){
                	n=3;
                }
            }
        }else{
        if(b==R){
        	n=1;
            if(c==R){
            	n=2;
            }
        }
		}
        if(a==S&&b==S&&c==R){
        	n=1;
        }

// 出力
        System.out.println(n);
    }
}

Compiler output:
Main.java:13: error: cannot find symbol
        if(a==R){
              ^
  symbol:   variable R
  location: class Main
Main.java:15: error: cannot find symbol
            if(b==R){
                  ^
  symbol:   variable R
  location: class Main
Main.java:22: error: cannot find symbol
        if(b==R){
              ^
  symbol:   variable R
  location: class Main
Main.java:24: error: cannot find symbol
            if(c==R){
                  ^
  symbol:   variable R
  location: class Main
Main.java:29: error: cannot find symbol
        if(a==S&&b==S&&c==R){
              ^
  symbol:   variable S
  location: class Main
Main.java:29: error: cannot find symbol
        if(a==S&&b==S&&c==R){
                    ^
  symbol:   variable S
  location: class Main
Main.java:29: error: cannot find symbol
        if(a==S&&b==S&&c==R){
                          ^
  symbol:   variable R
  location: class Main
7 errors
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<numeric>
using namespace std;

int main(void)
{
    string S;
    cin >> S;

    if(S == "RRR"){
        cout << 3 << endl;
    }
    else if(S=="SRR" || S=="RRS"){
        cout << 2 << endl;
    }
    else if (S=="SSR" || S=="SRS" || S="RSS" || S="RSR"){
        cout << 1 << endl;
    }
    else {
        cout << 0 << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:35: error: no match for 'operator||' (operand types are 'bool' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   19 |     else if (S=="SSR" || S=="SRS" || S="RSS" || S="RSR"){
      |              ~~~~~~~~~~~~~~~~~~~~ ^~ ~
      |                       |              |
      |                       bool           std::string {aka std::__cxx11::basic_string<char>}
a.cc:19:35: note: candidate: 'operator||(bool, bool)' (built-in)
   19 |     else if (S=="SSR" || S=="SRS" || S="RSS" || S="RSR"){
      |              ~~~~~~~~~~~~~~~~~~~~~^~~~
a.cc:19:35: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
a.cc:19:46: error: no match for 'operator||' (operand types are 'const char [4]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   19 |     else if (S=="SSR" || S=="SRS" || S="RSS" || S="RSR"){
      |                                        ~~~~~ ^~ ~
      |                                        |        |
      |                                        |        std::string {aka std::__cxx11::basic_string<char>}
      |                                        const char [4]
a.cc:19:46: note: candidate: 'operator||(bool, bool)' (built-in)
   19 |     else if (S=="SSR" || S=="SRS" || S="RSS" || S="RSR"){
      |                                        ~~~~~~^~~~
a.cc:19:46: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
Language: C++

#include <bits/stdc++.h>
using namespace std;  
typedef long long ll;
#define pb push_back
#define mod 1e9+7;
#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,start,end) for(int i=start; i<=end; i++)
#define repd(i,start,end) for(int i=start; i>=end; i--)
void solve()
{
   string s;
   cin>>s;
   int c=0
   rep(i,3)
   {
       if(s[i]=='R'&&s[i+1]=='R')
       {
           c++;
       }
   }
   cout<<c+1<<endl;
}

int main() {
	ios_base::sync_with_stdio(false);
	cout.tie(0); cin.tie(0);
	solve();
}  




Compiler output:
a.cc: In function 'void solve()':
a.cc:6:18: error: expected ',' or ';' before 'for'
    6 | #define rep(i,n) for(int i=0; i<n; i++)
      |                  ^~~
a.cc:14:4: note: in expansion of macro 'rep'
   14 |    rep(i,3)
      |    ^~~
a.cc:14:8: error: 'i' was not declared in this scope
   14 |    rep(i,3)
      |        ^
a.cc:6:31: note: in definition of macro 'rep'
    6 | #define rep(i,n) for(int i=0; i<n; i++)
      |                               ^
Language: C++

#include <iostream>
#include <string.h>
#include <math.h>
#include <cstdio>
using namespace std;
int main()
{
    char s[100];
    gets(s);
    int tmp = 0;
    int i = 0;
    int max1 = 0;
    while(s[i] != '\0') {
        if(s[i] == 'R') {
            tmp++;
            max1 = max(max1, tmp);
        }
        if(s[i] == 'S')
            tmp = 0;
        i++;
    }
    printf("%d\n",max1);
    system("pause");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |     gets(s);
      |     ^~~~
      |     getw