criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#define Int long long
#define all(x) begin(x),end(x)
#define endl "\n"
#define cy cout << "YES"<<endl 
#define cn cout<<"NO"<<endl
#define elif else if

using namespace std;

int main () {
		string s; cin >> s;
		int count{};
		int real{}};
		for(size_t i {}; i<3;i++){
			if(s[i]=='R')count++;
			elif(s[i]=='R'&&s[i+1]=='R'&&i<2)real++;
		}
		if(count == 0) real =0;
		
		cout << real << endl;
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: expected ',' or ';' before '}' token
   14 |                 int real{}};
      |                           ^
a.cc: At global scope:
a.cc:15:17: error: expected unqualified-id before 'for'
   15 |                 for(size_t i {}; i<3;i++){
      |                 ^~~
a.cc:15:34: error: 'i' does not name a type
   15 |                 for(size_t i {}; i<3;i++){
      |                                  ^
a.cc:15:38: error: 'i' does not name a type
   15 |                 for(size_t i {}; i<3;i++){
      |                                      ^
a.cc:19:17: error: expected unqualified-id before 'if'
   19 |                 if(count == 0) real =0;
      |                 ^~
a.cc:21:17: error: 'cout' does not name a type
   21 |                 cout << real << endl;
      |                 ^~~~
a.cc:22:5: error: expected unqualified-id before 'return'
   22 |     return 0;
      |     ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

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

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

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

#include <bits/stdc++.h>

using namespace std;

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




Compiler output:
a.cc:13:17: warning: missing terminating ' character
   13 |             else'
      |                 ^
a.cc:13:17: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:6:16: error: expected ',' or ';' before 'ans'
    6 | {   int c = 0. ans = 0;
      |                ^~~
a.cc:9:18: error: expected primary-expression before ';' token
    9 |     for (int i = ; i < s.size(); ++i)
      |                  ^
a.cc:12:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |                 c++; ans = max (ans, c);
      |                      ^~~
      |                      abs
a.cc:13:13: error: 'else' without a previous 'if'
   13 |             else'
      |             ^~~~
Language: Java



import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class RainySeason {
    public static void main(String[] args) {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    }
}


Compiler output:
Main.java:8: error: class RainySeason is public, should be declared in a file named RainySeason.java
public class RainySeason {
       ^
1 error
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;
  int ren = 0;
  for (int i = 0; i < 3; ++i){
    if(str1[i] == 'R'){
      if(len >= 1){
        if(len>=2){
          num = num +1;
          len = len +1;
        }
         else{
        lem = len +1;
        num = num +1;
      	}
      }
     
    }
    else{
      len = 1;
      num = 1;
    }
    
    
  }
  else{
    len = 0;
  }
  cout << num << endl;
  
  return 0;
  
  
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'len' was not declared in this scope; did you mean 'ren'?
   15 |       if(len >= 1){
      |          ^~~
      |          ren
a.cc:21:9: error: 'lem' was not declared in this scope
   21 |         lem = len +1;
      |         ^~~
a.cc:28:7: error: 'len' was not declared in this scope; did you mean 'ren'?
   28 |       len = 1;
      |       ^~~
      |       ren
a.cc:34:3: error: 'else' without a previous 'if'
   34 |   else{
      |   ^~~~
a.cc:35:5: error: 'len' was not declared in this scope; did you mean 'ren'?
   35 |     len = 0;
      |     ^~~
      |     ren
Language: C++

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

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

Compiler output:
a.cc:13:3: error: expected unqualified-id before '<<' token
   13 | } << 0 << endl;
      |   ^~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define ld double 
#define rep(i,a,b) for(ll i=a; i<b; ++i)
#define BOOST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(v) v.begin(),v.end()
#define sl(a) a.size()
#define mod 1000000007 
#define lcm(a,b) (a*b)/__gcd(a,b)
#define MAX1 100006
#define f first
#define s second
#define pi 2*acos(0.0)
void solve()
{
    string str;  cin>>str;
    ll max_len=1;
    ll n=sl(str);
    rep(i,0,n)
    {
        while(str[i]=='R') i++;
        max_len=max(max_len,i-j);
    }cout<<max_len;
}
int main()
{
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt","r",stdin);
    // for writing output to output.txt
    freopen("output.txt","w",stdout);
    #endif
    BOOST
    int T=1;  //cin>>T;
    while(T--) solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:31: error: 'j' was not declared in this scope
   25 |         max_len=max(max_len,i-j);
      |                               ^
Language: Java

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

    public class Solution 
    {
    public static void main(String args[]) {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       for(int i=0; i<3; i++) 
       {
         ch = str.charAt(i);
         if(ch =='R') rain++;
         else rain = 0;
       }
       
       System.out.println(rain);
       
    }
    }

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int count=0, maxa=INT_MIN;
  for(int i=0; i<s.size(); i++)
  {
    if(s[i]=='R')
    {
      count++;
      if(count>maxa)
        maxa=count;
    }
    else if(s[i]=='S')
    {
      count=0;
    }
  }
  cout<<maxxa<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'maxxa' was not declared in this scope; did you mean 'maxa'?
   21 |   cout<<maxxa<<endl;
      |         ^~~~~
      |         maxa
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

    else if(i-1>=0 && s[i-1]=='R' && s[i]=='R' && s[i+1]=='R')
        count++;

    else if(i==0 && s[i]=='R' && s[i+1]=='R')
        count+=2;

    else if(i==0 && s[i]=='R')
          count++; 

    else if(i-1>=0 && s[i-1]!='R' && s[i+1]!='R' && s[i]=='R')
          count++

    else
    {
      if(count > max)
      {
        max=count;
        count =0;
      }
    }
  }
  if(count>max)
    max=count;
  cout<<max;
  return -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: expected ';' before 'else'
   29 |           count++
      |                  ^
      |                  ;
   30 | 
   31 |     else
      |     ~~~~
Language: C

include<stdio.h>

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


Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c:20:1: error: expected identifier or '(' before '~' token
   20 | ~
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:57: error: expected primary-expression before '=' token
   13 |     else if (s[0] == 'R' || s[1] == 'R' || s[2] == 'R') = 1;
      |                                                         ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:8: error: 'i' undeclared (first use in this function)
    7 |   for (i=0; i<=2; i++){
      |        ^
main.c:7:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:11: warning: comparison between pointer and integer
   11 |   if (s[0]=="R" && s[1] == "R" && s[2] == "R"){
      |           ^~
main.c:11:25: warning: comparison between pointer and integer
   11 |   if (s[0]=="R" && s[1] == "R" && s[2] == "R"){
      |                         ^~
main.c:11:40: warning: comparison between pointer and integer
   11 |   if (s[0]=="R" && s[1] == "R" && s[2] == "R"){
      |                                        ^~
main.c:14:17: warning: comparison between pointer and integer
   14 |   }else if((s[0]=="R" && s[1]=="R") || s[1]=="R" && s[2]=="R"){
      |                 ^~
main.c:14:30: warning: comparison between pointer and integer
   14 |   }else if((s[0]=="R" && s[1]=="R") || s[1]=="R" && s[2]=="R"){
      |                              ^~
main.c:14:44: warning: comparison between pointer and integer
   14 |   }else if((s[0]=="R" && s[1]=="R") || s[1]=="R" && s[2]=="R"){
      |                                            ^~
main.c:14:57: warning: comparison between pointer and integer
   14 |   }else if((s[0]=="R" && s[1]=="R") || s[1]=="R" && s[2]=="R"){
      |                                                         ^~
main.c:17:16: warning: comparison between pointer and integer
   17 |   }else if(s[0]=="S" && s[1]=="S" && s[2]=="S"){
      |                ^~
main.c:17:29: warning: comparison between pointer and integer
   17 |   }else if(s[0]=="S" && s[1]=="S" && s[2]=="S"){
      |                             ^~
main.c:17:42: warning: comparison between pointer and integer
   17 |   }else if(s[0]=="S" && s[1]=="S" && s[2]=="S"){
      |                                          ^~
Language: Java

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

    public class solution 
    {
    public static void main(String args[]) {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       for(int i=0; i<3; i++) 
       {
         ch = str.charAt(i);
         if(ch =='R') rain++;
         else rain = 0;
       }
       
       System.out.println(rain);
       
    }
    }

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


int str_chnum(const char str[], int c)
{
    int i;
    int count = 0;
    
    for (i = 0; str[i] != '\0'; i++)
        if (str[i] == c)
            count++;
    return (count);
}

int main(void)
{
    char str[256];
    char ch[10];
    
    scanf("%s", str);
    
    
    printf("%d\n", str_chnum(str, ch[0]));
    
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'scanf' was not declared in this scope
   18 |     scanf("%s", str);
      |     ^~~~~
a.cc:21:5: error: 'printf' was not declared in this scope
   21 |     printf("%d\n", str_chnum(str, ch[0]));
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 |
Language: Java

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

import java.util.StringTokenizer;


public class Solution {

    private final static FastReader in = new FastReader();
    private static final PrintWriter out = new PrintWriter(System.out);


    public static int solve(String s) {
        if (s.contains("R")) {
            if (s.charAt(0) == 'R' && s.charAt(1) == 'R' && s.charAt(2) == 'R') {
                return 3;
            } else if (s.charAt(0) == 'R' && s.charAt(1) == 'R' ||
                    s.charAt(1) == 'R' && s.charAt(2) == 'R') {
                return 2;
            } else {
                return 1;
            }
        }
        return 0;

    }

    public static void main(String[] args) {

        out.println(solve(in.next()));

        out.flush();
    }

    private static final class FastReader {
        private static BufferedReader BF;
        private static StringTokenizer ST;

        public FastReader() {
            BF = new BufferedReader(new InputStreamReader(System.in));
            ST = null;
        }


        public final String next() {
            while (ST == null || !ST.hasMoreTokens()) {
                try {
                    ST = new StringTokenizer(BF.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return ST.nextToken();

        }

        final int nextInt() {
            return Integer.parseInt(next());
        }

    }


}


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

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

int main{
  char a, b, c;
  int rainy = 0;
  int streak = 0;
  cin >> a;
  if (a == 'r'){rainy++;}
  cin >> b;
  if (b == 'r'){rainy++;}
  else if (b == 's') {rainy = 0; if (rainy > streak){streak = rainy;}}
  cin >> c;
  if (c == 'r'){rainy++; streak++;}
  else if (c == 's') {rainy = 0;}
  cout << streak;
 
  return 0;
}


Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:5:3: error: expected primary-expression before 'char'
    5 |   char a, b, c;
      |   ^~~~
a.cc:5:3: error: expected '}' before 'char'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:8:3: error: 'cin' does not name a type
    8 |   cin >> a;
      |   ^~~
a.cc:9:3: error: expected unqualified-id before 'if'
    9 |   if (a == 'r'){rainy++;}
      |   ^~
a.cc:10:3: error: 'cin' does not name a type
   10 |   cin >> b;
      |   ^~~
a.cc:11:3: error: expected unqualified-id before 'if'
   11 |   if (b == 'r'){rainy++;}
      |   ^~
a.cc:12:3: error: expected unqualified-id before 'else'
   12 |   else if (b == 's') {rainy = 0; if (rainy > streak){streak = rainy;}}
      |   ^~~~
a.cc:13:3: error: 'cin' does not name a type
   13 |   cin >> c;
      |   ^~~
a.cc:14:3: error: expected unqualified-id before 'if'
   14 |   if (c == 'r'){rainy++; streak++;}
      |   ^~
a.cc:15:3: error: expected unqualified-id before 'else'
   15 |   else if (c == 's') {rainy = 0;}
      |   ^~~~
a.cc:16:3: error: 'cout' does not name a type
   16 |   cout << streak;
      |   ^~~~
a.cc:18:3: error: expected unqualified-id before 'return'
   18 |   return 0;
      |   ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<bits\stdc++.h>

using namespace std;

int main()
{

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


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

#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int count=0, maxa=INT_MIN;
  for(int i=0; i<s.length(); i++)
  {
    if(s[i]=='R')
    {
      count++;
      if(count>maxa)
        maxa=count;
    }
    else if(s[i]=='S')
    {
      count=0;
    }
  }
  cout<<maxxa<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'maxxa' was not declared in this scope; did you mean 'maxa'?
   21 |   cout<<maxxa<<endl;
      |         ^~~~~
      |         maxa
Language: C

#include <stdio.h>

int main(){
  
  char s[3];
  int i;
  
  for (i=0; i<=2; i++){
  scanf("%s", s[3]);
  }
  
  if ((s[0]="R" && s[1] = "R" && s[2] = "R")){
    printf("%d", 3);
    
  }else if((s[0]="R" && s[1]="R")||(s[1]="R" && s[2]="R")){
    printf("%d", 2);
      
  }else if((s[0]="S" && s[1] = "S" && s[2] = "S")){
    printf("%d", 0);
    
  }else{
    printf("%d", 1);
    
    
    
  }
  
}

Compiler output:
main.c: In function 'main':
main.c:12:39: error: lvalue required as left operand of assignment
   12 |   if ((s[0]="R" && s[1] = "R" && s[2] = "R")){
      |                                       ^
main.c:15:29: error: lvalue required as left operand of assignment
   15 |   }else if((s[0]="R" && s[1]="R")||(s[1]="R" && s[2]="R")){
      |                             ^
main.c:15:53: error: lvalue required as left operand of assignment
   15 |   }else if((s[0]="R" && s[1]="R")||(s[1]="R" && s[2]="R")){
      |                                                     ^
main.c:18:44: error: lvalue required as left operand of assignment
   18 |   }else if((s[0]="S" && s[1] = "S" && s[2] = "S")){
      |                                            ^
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 == RSR || S == SRS || S == SSR || S == RSS){
    cout << 1 << endl;
  }
  else{
    cout << 0 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'RRR' was not declared in this scope
    8 |   if(S == RRR){
      |           ^~~
a.cc:11:16: error: 'RRS' was not declared in this scope
   11 |   else if(S == RRS || S == SRR){
      |                ^~~
a.cc:11:28: error: 'SRR' was not declared in this scope
   11 |   else if(S == RRS || S == SRR){
      |                            ^~~
a.cc:14:16: error: 'RSR' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                ^~~
a.cc:14:28: error: 'SRS' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                            ^~~
a.cc:14:40: error: 'SSR' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                                        ^~~
a.cc:14:52: error: 'RSS' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                                                    ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  if(s="SSS")
    cout<<0<<"\n";
  if(s="RRR")
    cout<<3<<"\n";
  if(s="RRS")
    cout<<2<<"\n";
  if(s="RSR")
    cout<<1<<"\n";
  if(s="SRR")
    cout<<2<<"\n";
  if(s="SSR")
    cout<<1<<"\n";
  if(s="SRS")
    cout<<1<<"\n";
  if(s="RSS")
    cout<<1<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SSS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |   if(s="SSS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:9:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RRR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   if(s="RRR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:11:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RRS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |   if(s="RRS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:13:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RSR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   13 |   if(s="RSR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:15:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SRR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   15 |   if(s="SRR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:17:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SSR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   17 |   if(s="SSR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:19:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SRS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   19 |   if(s="SRS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:21:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RSS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   21 |   if(s="RSS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
Language: C++

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

int main()
{
    String res;
    cin>>res;
    int n=res.size();
    int right=0,ans=0;
    if(n==0)
    {
        cout<<ans;
        return 0;
    }
    else
    {
        int count=0;
        while(right<n)
        {
            if(res[right]=='R')
            {
                count++;
                ans=max(ans,count);
                right++;
            }
            else
            {
                count=0;
                right++;
            }
        }
    }
    
    
    cout<<ans;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'String' was not declared in this scope
    6 |     String res;
      |     ^~~~~~
a.cc:7:10: error: 'res' was not declared in this scope
    7 |     cin>>res;
      |          ^~~
Language: C++

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

int main() {
  
  string s;
  cin >> s;
  
  char a = s.at(0);
  char b = s.at(1);
  char c = s.at(2);
  
  int num = 0;
  
  for (int i = 0; i < 3 i++){
    if (s.at(i) == 'S'){
      num = num + 1;
    }
  }
  
  if (num == 3){
    cout << 0 << endl;
  }
  else if (num == 2){
    cout << 1 << endl;
  }
  else if (num == 0){
    cout << 3 << endl;
  } //こっからしたはS = 1だけ
  else if (b == 'S'){
    cout << 1 << endl;
  }
  else if (b != 'S'){
    cout << 2 << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: expected ';' before 'i'
   15 |   for (int i = 0; i < 3 i++){
      |                        ^~
      |                        ;
a.cc:35:4: error: expected '}' at end of input
   35 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  char a,b,c;
  cin >> a >> b >> c;
  if(a == 'R' && b == 'R' && c == 'R'){
    cout << 3 << endl;
  }
  if(a == 'S' && b == 'R' && c == 'R'){
    cout << 2 << endl;
  if(a == 'R' && b == 'R' && c == 'S'){
    cout << 2 << endl;
  }
  if(a == 'R' && b == 'S' && c == 'S'){
    cout << 1 << endl;
  if(a == 'S' && b == 'R' && c == 'S'){
    cout << 1 << endl;
  if(a == 'S' && b == 'S' && c == 'R'){
    cout << 1 << endl;
  }
  if(a == 'S' && b == 'S' && c == 'S'){
    cout << 0 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:15:39: note: to match this '{'
   15 |   if(a == 'R' && b == 'S' && c == 'S'){
      |                                       ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:10:39: note: to match this '{'
   10 |   if(a == 'S' && b == 'R' && c == 'R'){
      |                                       ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string str1;
  cin >> str1;
int countA(char* my_str){
    int i, count = 0;
    for(i = 0;my_str[i]!='\0';i++){
        if(my_str[i] == 'R'){
            count++;
        }
    }
    return count;
}

if(countA(str1)==2){
 if(str1[1]==R){
 cout << 2 << endl}
 else{
 cout << 1 << endl}
}
else{
 cout << countA(str1) << endl}}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: a function-definition is not allowed here before '{' token
    7 | int countA(char* my_str){
      |                         ^
a.cc:17:4: error: 'countA' was not declared in this scope
   17 | if(countA(str1)==2){
      |    ^~~~~~
a.cc:18:14: error: 'R' was not declared in this scope
   18 |  if(str1[1]==R){
      |              ^
a.cc:19:19: error: expected ';' before '}' token
   19 |  cout << 2 << endl}
      |                   ^
      |                   ;
a.cc:21:19: error: expected ';' before '}' token
   21 |  cout << 1 << endl}
      |                   ^
      |                   ;
Language: Java

import java.util.Scanner;

// 提出時にclass Main に書き換え
public class A {
	public static void main(String[] args)  {
		// 標準入力を受け取る
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine(); // String Sを受け取る
		sc.close(); // 標準入力を終了



		int r = 0; // 連続した雨の日数
		int rm = 0; // 連続した雨の日数(最大値)

		while(S.length() > 0) {
			if(S.startsWith("R")) {
				r += 1; // 連続した雨の日数を加算
			} else {
				r = 0; // 連続した雨の日数を加算
			}
			// 最大値更新
			if(r > rm) {rm = r;}
			// Sの先頭の文字を消去
			S = removeLeadingZeroes(S);
		}
		System.out.println(rm);
	}

	// 文字列の先頭を削除するメソッド
	static String removeLeadingZeroes(String s) {
	    StringBuilder sb = new StringBuilder(s);
	    if (sb.length() > 0) {
	        sb.deleteCharAt(0);
	    }
	    return sb.toString();
	}

}

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

#include<iostream>

using namespace std;

int main()
{
    int cnt=0;a
string s;
cin>>s;
int n=s.size();
for(int i=0;i<n;i++){
    if(s[i]=='R'){
        cnt++;
    } 
    else if(s[i]=='R' && s[i+2]=='R'){
        cnt=1;
    }
    else{
        cnt=0;
    }

}
cout<<cnt<<endl;

return 0;
}








Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'a' was not declared in this scope
    7 |     int cnt=0;a
      |               ^
a.cc:9:6: error: 's' was not declared in this scope
    9 | cin>>s;
      |      ^
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 == RSR || S == SRS || S == SSR || S == RSS){
    cout << 1 << endl;
  }
  else{
    cout << 0 << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'RRR' was not declared in this scope
    8 |   if(S == RRR){
      |           ^~~
a.cc:11:16: error: 'RRS' was not declared in this scope
   11 |   else if(S == RRS || S == SRR){
      |                ^~~
a.cc:11:28: error: 'SRR' was not declared in this scope
   11 |   else if(S == RRS || S == SRR){
      |                            ^~~
a.cc:14:16: error: 'RSR' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                ^~~
a.cc:14:28: error: 'SRS' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                            ^~~
a.cc:14:40: error: 'SSR' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                                        ^~~
a.cc:14:52: error: 'RSS' was not declared in this scope
   14 |   else if(S == RSR || S == SRS || S == SSR || S == RSS){
      |                                                    ^~~
a.cc:19:4: error: expected '}' at end of input
   19 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main{
  char a, b, c;
  int rainy = 0;
  int streak = 0;
  cin >> a;
  if (a == 'r'){rainy++;}
  cin >> b;
  if (b == 'r'){rainy++;}
  elif (b == 's') {rainy = 0; if (rainy > streak){streak = rainy;}}
  cin >> c;
  if (c == 'r'){rainy++;, streak++;}
  else if (c == 's') {rainy = 0;}
  cout << streak;
 
}

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:5:3: error: expected primary-expression before 'char'
    5 |   char a, b, c;
      |   ^~~~
a.cc:5:3: error: expected '}' before 'char'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:8:3: error: 'cin' does not name a type
    8 |   cin >> a;
      |   ^~~
a.cc:9:3: error: expected unqualified-id before 'if'
    9 |   if (a == 'r'){rainy++;}
      |   ^~
a.cc:10:3: error: 'cin' does not name a type
   10 |   cin >> b;
      |   ^~~
a.cc:11:3: error: expected unqualified-id before 'if'
   11 |   if (b == 'r'){rainy++;}
      |   ^~
a.cc:12:8: error: expected constructor, destructor, or type conversion before '(' token
   12 |   elif (b == 's') {rainy = 0; if (rainy > streak){streak = rainy;}}
      |        ^
a.cc:13:3: error: 'cin' does not name a type
   13 |   cin >> c;
      |   ^~~
a.cc:14:3: error: expected unqualified-id before 'if'
   14 |   if (c == 'r'){rainy++;, streak++;}
      |   ^~
a.cc:15:3: error: expected unqualified-id before 'else'
   15 |   else if (c == 's') {rainy = 0;}
      |   ^~~~
a.cc:16:3: error: 'cout' does not name a type
   16 |   cout << streak;
      |   ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: Java


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


public class main {
    public static void main(String[] args) {
        Scanner saj = new Scanner(System.in);
        String work = saj.next();
        int ann=0;
        int maxlen=0;
        boolean stat=false;
        for(int i=0;i<work.length();i++){
            if(stat=true){
                if(work.charAt(i)=='R'){
                    ann++;
                    if(maxlen<=ann){
                        maxlen=ann;
                    }
                }
                else{
                    if(maxlen<=ann){
                        maxlen=ann;

                    }
                    ann=0;
                    stat=false;
                }
            }
            else{
                if(work.charAt(i)=='R'){
                    stat=true;
                    ann++;
                }
                else{
                    stat=false;
                }

            }
        }
        System.out.println(maxlen);

    }

}





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

#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  getline(cin,s);
  if(s="SSS")
    cout<<0<<"\n";
  if(s="RRR")
    cout<<3<<"\n";
  if(s="RRS")
    cout<<2<<"\n";
  if(s="RSR")
    cout<<1<<"\n";
  if(s="SRR")
    cout<<2<<"\n";
  if(s="SSR")
    cout<<1<<"\n";
  if(s="SRS")
    cout<<1<<"\n";
  if(s="RSS")
    cout<<1<<"\n";
  return 0;
}

      
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SSS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |   if(s="SSS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:9:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RRR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   if(s="RRR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:11:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RRS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |   if(s="RRS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:13:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RSR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   13 |   if(s="RSR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:15:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SRR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   15 |   if(s="SRR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:17:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SSR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   17 |   if(s="SSR")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:19:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SRS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   19 |   if(s="SRS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:21:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RSS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   21 |   if(s="RSS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
Language: Java

// 提出時にclass Main に書き換え
public class Main {
	public static void main(String[] args)  {
		// 標準入力を受け取る
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine(); // String Sを受け取る
		sc.close(); // 標準入力を終了

		int r = 0; // 連続した雨の日数
		int rm = 0; // 連続した雨の日数(最大値)

		while(S.length() > 0) {
			if(S.startsWith("R")) {
				r += 1; // 連続した雨の日数を加算
			} else {
				r = 0; // 連続した雨の日数を加算
			}
			// 最大値更新
			if(r > rm) {rm = r;}
			// Sの先頭の文字を消去
			S = removeLeadingZeroes(S);
		}
		System.out.println(rm);
	}

	// 文字列の先頭を削除するメソッド
	static String removeLeadingZeroes(String s) {
	    StringBuilder sb = new StringBuilder(s);
	    if (sb.length() > 0) {
	        sb.deleteCharAt(0);
	    }
	    return sb.toString();
	}

}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

#include<iostream>

using namespace std;

int main()
{
    int cnt=0;
string s;
cin>>s;
int n=s.size();
for(int i=0;i<n;i++){
    if(s[i]=='R'){
        cnt++;
    } 
    else if(s[i]=='R' && s[i+2]=='R'){
        cnt=1;
    }
    else{
        cnt=0;
    }

}
cout<<cnt<<endl;

return 0;
}








Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
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 s;
  cin >> s;
  int ans = 0;
  if (s.at(0) == 'R' && s.at(1) == 'R' && s.at(2) == 'R') {
    ans = 2;
  } else if (s.at(0) == 'R' && s.at(1) == 'R') {
    ans = 2;
  } else if (s.at(1) == 'R' && s.at(2)) == 'R') {
    ans = 3;
  } else if (s.at(0) == 'R') {
    ans = 1;
  } else if (s.at(1) == 'R') {
    ans = 1;
  } else if (s.at(2) == 'R') {
    ans = 1;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:41: error: expected primary-expression before '==' token
   15 |   } else if (s.at(1) == 'R' && s.at(2)) == 'R') {
      |                                         ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
    int ans=0,i,c=1;
    for(i=0;i<3;i++)
    {
    	if(s[i]=='R' && c==1)
    	ans++;
    	if(s[i]=='S')
    	c=0;
    	if(s[iSSSS]=='R' && c==0)
    	c=1;
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: 'iSSSS' was not declared in this scope
   14 |         if(s[iSSSS]=='R' && c==0)
      |              ^~~~~
Language: C

#include <stdio.h>

int main(){
  
  char s[3];
  
  for (i=0; i<=2; i++){
  scanf("%s", s[3]);
  }
  
  if (s[0]="R" && s[1] = "R" && s[2] = "R"){
    printf("%d", 3);
    
  }else if((s[0]="R" && s[1]="R") || s[1]="R" && s[2]="R"){
    printf("%d", 2);
      
  }else if(s[0]="S" && s[1] = "S" && s[2] = "S"){
    printf("%d", 0);
    
  }else{
    printf("%d", 1);
    
    
    
  }
  
}

Compiler output:
main.c: In function 'main':
main.c:7:8: error: 'i' undeclared (first use in this function)
    7 |   for (i=0; i<=2; i++){
      |        ^
main.c:7:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:38: error: lvalue required as left operand of assignment
   11 |   if (s[0]="R" && s[1] = "R" && s[2] = "R"){
      |                                      ^
main.c:14:29: error: lvalue required as left operand of assignment
   14 |   }else if((s[0]="R" && s[1]="R") || s[1]="R" && s[2]="R"){
      |                             ^
main.c:14:54: error: lvalue required as left operand of assignment
   14 |   }else if((s[0]="R" && s[1]="R") || s[1]="R" && s[2]="R"){
      |                                                      ^
main.c:17:43: error: lvalue required as left operand of assignment
   17 |   }else if(s[0]="S" && s[1] = "S" && s[2] = "S"){
      |                                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int l = s.length();
	int count = 0;
	if(s[0]='R' && s[1]=='R' && s[2]=='R')
		{
			cout<<"3"
		}
		else if(s[0]=='R' && s[1]=='R' && s[2]!='R')
		{
			cout<<"2";
		}
		else if(s[0]=='R' && s[1]=='S')
		{
			cout<<"1";
		}
		else
		{
			cout<<"0";
		}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: expected ';' before '}' token
   11 |                         cout<<"3"
      |                                  ^
      |                                  ;
   12 |                 }
      |                 ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string S;
    cin >>S;
    
        if(S.at(0)=='S'&&S.at(1)=='S'&&S.at(2)=='S'){
            cout <<0<<endl;
        }
         else if(S.at(0)=='S'&&S.at(1)=='S'&&S.at(2)=='R'){
            cout <<1<<endl;
        }
                 else if(S.at(0)=='S'&&S.at(1)=='R'&&S.at(2)=='R'){
            cout <<2<<endl;
        }
                 else if(S.at(0)=='S'&&S.at(1)=='R'&&S.at(2)=='S'){
            cout <<1<<endl;
        }
                 else if(S.at(0)=='R'&&S.at(1)=='S'&&S.at(2)=='S'){
            cout <<1<<endl;
            
        }
                 else if(S.at(0)=='R'&&S.at(1)=='S'&&S.at(2)=='R'){
            cout <<1<<endl;
        }
                         else if(S.at(0)=='R'&&S.at(1)=='R'&&S.at(2)=='S'){
            cout <<2<<endl;
        }
                         else if(S.at(0)=='R'&&S.at(1)=='R'&&S.at(2)=='R'){
            cout <<3<<endl;
        }

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

#include <cstdio>
#include <iostream>
using namespace std;
int main(){
	string s;
	cin >> s;
	if(s == "SSS") printf("0\n");
	if(s == "RSS" || s == "RSR" || s == "SRS" || s == "SSR" || ) printf("1\n");
	if(s == "RRS" || s == "SRR") printf("2\n");
	if(s == "RRR") printf("3\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:68: error: expected primary-expression before ')' token
    8 |         if(s == "RSS" || s == "RSR" || s == "SRS" || s == "SSR" || ) printf("1\n");
      |                                                                    ^
Language: C++

#include<iostream>

using namespace std;

int main()
{
  string str;
  cin>>str;
  int cnt=0;
  for(int i=0;i<3;++i)
  {
    if(str[i]=="R")
      cnt+=1;
  }
  if(cnt==2 && str[2]!="R")
    cout<<cnt-1;
  else
    cout<<cnt;
  
  return 0;
}
  
   
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if(str[i]=="R")
a.cc:15:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   if(cnt==2 && str[2]!="R")
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string S;
    cin >>S;
    
        if(S.at(0)=='S'&&S.at(1)=='S'&&S.at(2)=='S'){
            cout <<0<<endl;
        }
         else if(S.at(0)=='S'&&S.at(1)=='S'&&S.at(2)=='R'){
            cout <<1<<endl;
        }
                 else if(S.at(0)=='S'&&S.at(1)=='R'&&S.at(2)=='R'){
            cout <<2<<endl;
        }
                 else if(S.at(0)=='S'&&S.at(1)=='R'&&S.at(2)=='S'){
            cout <<1<<endl;
        }
                 else if(S.at(0)=='R'&&S.at(1)=='S'&&S.at(2)=='S'){
            cout <<1<<endl;
            
        }
                 else if(S.at(0)=='R'&&S.at(1)=='S'&&S.at(2)=='R'){
            cout <<1<<endl;
        }
                         else if(S.at(0)=='R'&&S.at(1)=='R'&&S.at(2)=='S'){
            cout <<2<<endl;
        }
                         else if(S.at(0)=='R'&&S.at(1)=='R'&&S.at(2)=='R'){
            cout <<3<<endl;
        }
    

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

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

int main()
{
    int count=0, i;
    char s[4];
    gets(s);

    for(i=0; i<3; i++)
    {
        if(s[i]==82)
            count++;
    }
    printf("%d\n", count);

    return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

int main()
{
    vector<char> S(3);
    for(char &c:S) cin >> c;

    int counter = count(S.begin(),S.end(),'R');
    if(S[1] == 'R')
        cout << counter;
    else if (counter == 2)
        cout << counter - 1;
    else
        cout << counter;



    return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  if(S == "RRR"){
    cout << 3;
  }
  if(S == "RRS" || S == "SRR"){
    cout << 2;
  }
  if(S == "RSR" || S == "RSS" || S == "SRS" || S == "SSR"){
    cout << 1;
  }
  if(S == "SSS" ||){
    cout << 0;
  }
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: expected primary-expression before ')' token
   16 |   if(S == "SSS" ||){
      |                   ^