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

#include <bits/stdc++.h>

//typedef long long ll;

using namespace std;

int main()
{
    //ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    char s[50];
    int count = 0;
    gets(s);

    for(int i=0; s[i]!='\0'; ++i)
    {
        if(s[i] == 'R')
        {
            count++;
        }

        else if(s[0] == 'S' && s[1] == 'R' && s[2] == 'R')
        {
            count = 0;
        }
        else if(s[0] == 'S' && s[1] == 'R' && s[2] == 'S')
        {
            count = 1;
        }
        else if(s[0] == 'S' && s[1] == 'S' && s[2] == 'R')
        {
            count = 0;
        }
        else
        {
            count = count;
            break;
        }
    }

    cout << count << endl;




}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |     gets(s);
      |     ^~~~
      |     getw
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;

        
        if(a.equals("S") && b.equals("S") && c.equals("S")){
        	n=0;
        }
      
        if(a.equals("S") && b.equals("S") && c.equals("R")){
        	n=1;
        }
      
        if(a.equals("S") && b.equals("R") && c.equals("S")){
        	n=1;
        }        
      
        if(a.equals("R") && b.equals("S") && c.equals("S")){
        	n=1;
        }
      
        if(a.equals("R") && b.equals("R") && c.equals("S")){
        	n=2;
        }
      
        if(a.equals("S") && b.equals("R") && c.equals("R")){
        	n=2;
        }
 
        if(a.equals("R") && b.equals("R") && c.equals("R")){
        	n=3;
        }
      
        if(a.equals("R") && b.equals("S") && c.equals("R")){
        	n=1;
        }
      

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


Compiler output:
Main.java:47: error: variable n might not have been initialized
        System.out.println(n);
                           ^
1 error
Language: C++

//Author : Vipul Sharma

// LIBRARIES
#include <bits/stdc++.h>

// MACROS
#define ll long long int
#define ld long double
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define rev(i,b,a) for(ll i=b-1;i>=a;i--)
#define eqrep(i,a,b) for(ll i=1;i<=b;i++)
#define itrep(at) for (auto it = at.begin(); it != at.end(); it++)
#define ld long double
#define pb push_back
#define w(t) while (t--)
#define booster                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
#define mod 1000000007
#define endl "\n"
# define INF 0x3f3f3f3f 
#define deb1(x) cout << #x << " : " << x << endl;
#define deb2(x, y) cout << #x << " : " << x << "\t" << #y << " : " << y << endl;
#define deb3(x, y, z) cout << #x << " : " << x << "\t" << #y << " : " << y << "\t" << #z << " : " << z << endl;
#define deb4(x, y, z, w) cout << #x << " : " << x << "\t" << #y << " : " << y << "\t" << #z << " : " << z << "\t" << #w << " : " << w << endl;
#define deb5(a, b, c, d, e) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define deb6(a, b, c, d, e, f) cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

using namespace std;
long long cost = 1e18;

void solve()
{
	string s;
	cin>>s;
	ll res=1;
	//if(s[i]=='R' and s[i+1]=='S') res=1;
	if(s[i]=='R' and s[i+1]=='R' and s[i+2]=='R') res=3;
	if(s[i]=='R' and s[i+1]=='R') res=2;
	if(s[i+1]=='R' and s[i+2]=='R') res=2;
	if(s[i]!='R' and s[i+1]!='R' and s[i+2]!='R') res=0;
	cout<<res<<endl;
}


int main()
{
	
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    booster;
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:38:14: error: 'i' was not declared in this scope
   38 |         if(s[i]=='R' and s[i+1]=='R' and s[i+2]=='R') res=3;
      |              ^
a.cc:39:14: error: 'i' was not declared in this scope
   39 |         if(s[i]=='R' and s[i+1]=='R') res=2;
      |              ^
a.cc:40:14: error: 'i' was not declared in this scope
   40 |         if(s[i+1]=='R' and s[i+2]=='R') res=2;
      |              ^
a.cc:41:14: error: 'i' was not declared in this scope
   41 |         if(s[i]!='R' and s[i+1]!='R' and s[i+2]!='R') res=0;
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int a;
  a = 3
  cin >> S;
  if(S == "S") {
    a--;
  }
  cin >> S;
  if(S == "S") {
    if(a == 3) {
      a =1;
    }
    else{
      a--;
    }
  }
  cin >> S;
  if(S =="S") {
    a--;
  }
  cout <<a;
      

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: expected ';' before 'cin'
    6 |   a = 3
      |        ^
      |        ;
    7 |   cin >> S;
      |   ~~~   
a.cc:24:12: error: expected '}' at end of input
   24 |   cout <<a;
      |            ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: Java

import java.util.Scanner;

import sun.tools.jar.resources.jar;

public class Main{
    public static Scanner scan  = new Scanner(System.in);
    public static void main(String[]args){
        String s = next();
        if(s.contains("RRR")){
            print(3);
        }
        else if(s.contains("RR")){
            print(2);
        }
        else print(0);
    }


    public static int nextInt(){
        return Integer.parseInt(scan.next());
    }
    public static long nextLong(){
        return Long.parseLong(scan.next());
    }
    public static String next(){
        return scan.next();
    }
    public static double nextDouble(){
        return Double.parseDouble(scan.next());
    }
    public static float nextFloat(){
        return Float.parseFloat(scan.next());
    }

    //Yes or No
    public static void yesNo(boolean flag){
        if(flag) System.out.println("Yes");
        else System.out.println("No");
    }

    //print
    public static void print(Object a){
        System.out.println(a);
    }


    //gcd
    public static int gcd (int a, int b){
        int tmp;
        while((tmp = a%b) != 0){
            a = b;
            b = tmp;
        }
        return b;
    }


    //lcm
    public static int lcm(int a,int b){
        int tmp;
        long c = a;
        c *= b;
        while((tmp = a%b) != 0){
            a = b;
            b = tmp;
        }
        return (int)(c/b);
    }
}

Compiler output:
Main.java:3: error: package sun.tools.jar.resources is not visible
import sun.tools.jar.resources.jar;
                    ^
  (package sun.tools.jar.resources is declared in module jdk.jartool, which does not export it)
1 error
Language: C++

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


int countR(string str0) {
 
for (int i = 0; i < 3; i++) {
  if(str0[i]==R){
  k = k+1 }
  return k }
 
};

int main() {
  string str0;
  cin >> str0;
 
 
if( countR(str0)==2 ){
 if(str0[1]==R){
 cout << 2 << endl}
 else{
 cout << 1 << endl}
}
else{
 cout << countR(str0) << endl}}

Compiler output:
a.cc: In function 'int countR(std::string)':
a.cc:8:15: error: 'R' was not declared in this scope
    8 |   if(str0[i]==R){
      |               ^
a.cc:9:3: error: 'k' was not declared in this scope
    9 |   k = k+1 }
      |   ^
a.cc:10:10: error: 'k' was not declared in this scope
   10 |   return k }
      |          ^
a.cc:10:11: error: expected ';' before '}' token
   10 |   return k }
      |           ^~
      |           ;
a.cc: In function 'int main()':
a.cc:20:14: error: 'R' was not declared in this scope
   20 |  if(str0[1]==R){
      |              ^
a.cc:21:19: error: expected ';' before '}' token
   21 |  cout << 2 << endl}
      |                   ^
      |                   ;
a.cc:23:19: error: expected ';' before '}' token
   23 |  cout << 1 << endl}
      |                   ^
      |                   ;
a.cc:26:30: error: expected ';' before '}' token
   26 |  cout << countR(str0) << endl}}
      |                              ^
      |                              ;
Language: C++

// C++ program to find the maximum consecutive 
// repeating character in given string 
#include<bits/stdc++.h> 
using namespace std; 

// function to find out the maximum repeating 
// character in given string 
int maxRepeating(string str) 
{ 
	int len = str.length(); 
	int count = 0; 

	// Find the maximum repeating character 
	// starting from str[i] 
	for (int i=0; i<len; i++) 
	{ 
    int cur_count = 1; 
    if(str[i]=='r'){

		for (int j=i+1; j<len; j++) 
		{ 
			if (str[j] != 'r') 
				break; 
			cur_count++; 
		} 
    }
		// Update result if required 
		if (cur_count > count) 
		{ 
			count = cur_count; 

		} 
	} 
	return count; 
} 

// Driver code 
int main() 
{ 

	string str ; 
  getline(cin,s);
	cout << maxRepeating(str); 
	return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:42:15: error: 's' was not declared in this scope
   42 |   getline(cin,s);
      |               ^
Language: Java

import objectdraw.*;
import java.awt.*;

public class RainySeason extends WindowController{
  private String inputString;
  private String[] letters=new String[3];
  private int intToReturn=0;
  
 public int compute(String S){
  inputString=S;
  for (int count=0;count<3;count++){
    letters[count]=inputString.chartAt(count);
   }
  if (inputString.equals("RRR")){
  intToReturn=3;
  }
   else if(inputString.equals("SSS")){
   intToReturn=0;
   } 
   else if (letters[1].equals("S"))    {
    intToReturn=1;
   }
    else if (letters[0].equals("S")&&letters[2].equals("S")){
    intToReturn=1;
    }
    else{
    intToReturn=2;
    }
   return intToReturn;
  }
}

Compiler output:
Main.java:4: error: class RainySeason is public, should be declared in a file named RainySeason.java
public class RainySeason extends WindowController{
       ^
Main.java:4: error: cannot find symbol
public class RainySeason extends WindowController{
                                 ^
  symbol: class WindowController
Main.java:1: error: package objectdraw does not exist
import objectdraw.*;
^
Main.java:12: error: cannot find symbol
    letters[count]=inputString.chartAt(count);
                              ^
  symbol:   method chartAt(int)
  location: variable inputString of type String
4 errors
Language: C++

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

int main() {
	string S;
	cin >> S;
	string S1 = RRR, S2 = RRS, S3 = SRR, S4 = SSS;

	if (S == S1) {
		cout << 3 << endl;
	}
	else if (S == S2 || S == S3) {
		cout << 2 << endl;
	}
	else if (S == S4) {
		cout << 0 << endl;
	}
	else {
		cout << 1 << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 'RRR' was not declared in this scope
    8 |         string S1 = RRR, S2 = RRS, S3 = SRR, S4 = SSS;
      |                     ^~~
a.cc:13:23: error: 'S2' was not declared in this scope; did you mean 'S1'?
   13 |         else if (S == S2 || S == S3) {
      |                       ^~
      |                       S1
a.cc:13:34: error: 'S3' was not declared in this scope; did you mean 'S1'?
   13 |         else if (S == S2 || S == S3) {
      |                                  ^~
      |                                  S1
a.cc:16:23: error: 'S4' was not declared in this scope; did you mean 'S1'?
   16 |         else if (S == S4) {
      |                       ^~
      |                       S1
Language: Java

import java.util.Scanner;

import sun.tools.jar.resources.jar;

public class Main{
    public static Scanner scan  = new Scanner(System.in);
    public static void main(String[]args){
        String s = next();
        if(s.contains("RR")){
            print(2);
        }
        else if(s.contains("RRR")){
            print(3);
        }
        else print(0);
    }


    public static int nextInt(){
        return Integer.parseInt(scan.next());
    }
    public static long nextLong(){
        return Long.parseLong(scan.next());
    }
    public static String next(){
        return scan.next();
    }
    public static double nextDouble(){
        return Double.parseDouble(scan.next());
    }
    public static float nextFloat(){
        return Float.parseFloat(scan.next());
    }

    //Yes or No
    public static void yesNo(boolean flag){
        if(flag) System.out.println("Yes");
        else System.out.println("No");
    }

    //print
    public static void print(Object a){
        System.out.println(a);
    }


    //gcd
    public static int gcd (int a, int b){
        int tmp;
        while((tmp = a%b) != 0){
            a = b;
            b = tmp;
        }
        return b;
    }


    //lcm
    public static int lcm(int a,int b){
        int tmp;
        long c = a;
        c *= b;
        while((tmp = a%b) != 0){
            a = b;
            b = tmp;
        }
        return (int)(c/b);
    }
}

Compiler output:
Main.java:3: error: package sun.tools.jar.resources is not visible
import sun.tools.jar.resources.jar;
                    ^
  (package sun.tools.jar.resources is declared in module jdk.jartool, which does not export it)
1 error
Language: C++

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

int main() {
  int x;
  string str >> x;

  if (x == RRR) {
    cout << "3" << endl;
  }

  if (x == RRS || x == SRR ) {
    cout << "2" << endl;
  }

  if (x == RSS || x == SRS || x == SSR) {
    cout << "1" << endl;
  }

  cout << "終了" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected initializer before '>>' token
    6 |   string str >> x;
      |              ^~
a.cc:8:12: error: 'RRR' was not declared in this scope
    8 |   if (x == RRR) {
      |            ^~~
a.cc:12:12: error: 'RRS' was not declared in this scope
   12 |   if (x == RRS || x == SRR ) {
      |            ^~~
a.cc:12:24: error: 'SRR' was not declared in this scope
   12 |   if (x == RRS || x == SRR ) {
      |                        ^~~
a.cc:16:12: error: 'RSS' was not declared in this scope
   16 |   if (x == RSS || x == SRS || x == SSR) {
      |            ^~~
a.cc:16:24: error: 'SRS' was not declared in this scope
   16 |   if (x == RSS || x == SRS || x == SSR) {
      |                        ^~~
a.cc:16:36: error: 'SSR' was not declared in this scope
   16 |   if (x == RSS || x == SRS || x == SSR) {
      |                                    ^~~
Language: C++

#include <iostream>
#include <string>
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 << endl;
	}
	else {
		cout << 1 << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'RRR' was not declared in this scope
    9 |         if (S == RRR) {
      |                  ^~~
a.cc:12:23: error: 'RRS' was not declared in this scope
   12 |         else if (S == RRS || S == SRR) {
      |                       ^~~
a.cc:12:35: error: 'SRR' was not declared in this scope
   12 |         else if (S == RRS || S == SRR) {
      |                                   ^~~
a.cc:15:23: error: 'SSS' was not declared in this scope
   15 |         else if (S == SSS) {
      |                       ^~~
Language: C++

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

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

import java.util.*;
public class main
{
	public static void main(String[] args) {
		Scanner si=new Scanner(System.in);
		String str;
		
		str=si.next();
		
		char ch[]=str.toCharArray();
		
		int n=str.length(),count=1;
		
		for(int i=0;i<n-1;i++)
		    if(ch[i]=='R' && ch[i+1]=='R')
		        count++;
		    else if(ch[0]=='R' && ch[2]=='R' && count==1||ch[1]=='R' && ch[2]=='S' && count==1|| ch[0]=='R'&& count==1 || ch[2]=='R'&& count==1)
		        count=1;
		    else if(ch[i]!='R' && count==1)
		        count=0;
		
		System.out.println(count);
		si.close();
	}
}


Compiler output:
Main.java:2: error: class main is public, should be declared in a file named main.java
public class main
       ^
1 error
Language: Java

import java.util.*;
public class hello
{
	public static void main(String[] args) {
		Scanner si=new Scanner(System.in);
		String str;
		
		str=si.next();
		
		char ch[]=str.toCharArray();
		
		int n=str.length(),count=1;
		
		for(int i=0;i<n-1;i++)
		    if(ch[i]=='R' && ch[i+1]=='R')
		        count++;
		    else if(ch[0]=='R' && ch[2]=='R' && count==1||ch[1]=='R' && ch[2]=='S' && count==1|| ch[0]=='R'&& count==1 || ch[2]=='R'&& count==1)
		        count=1;
		    else if(ch[i]!='R' && count==1)
		        count=0;
		
		System.out.println(count);
		si.close();
	}
}


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

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

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

Compiler output:
main.c: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>
#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(ren >= 1){
        if(ren>=2){
          num = num +1;
          ren = ren +1;
        }
         else{
        ren = ren +1;
        num = num +1;
      	}
      }
    }
      else{
      ren = 1;
      num = 1;
    }
   
    
    
  }
  else{
    ren = 0;
  }
  cout << num << endl;
  
  return 0;
  
  
 
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:3: error: 'else' without a previous 'if'
   34 |   else{
      |   ^~~~
Language: C++

#include <iostream>
using namespace std;

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;
};
int main() {
  string str1;
  cin >> str1;


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:18:11: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   18 | if(countA(str1)==2){
      |           ^~~~
      |           |
      |           std::string {aka std::__cxx11::basic_string<char>}
a.cc:4:18: note:   initializing argument 1 of 'int countA(char*)'
    4 | int countA(char* my_str){
      |            ~~~~~~^~~~~~
a.cc:19:14: error: 'R' was not declared in this scope
   19 |  if(str1[1]==R){
      |              ^
a.cc:20:19: error: expected ';' before '}' token
   20 |  cout << 2 << endl}
      |                   ^
      |                   ;
a.cc:22:19: error: expected ';' before '}' token
   22 |  cout << 1 << endl}
      |                   ^
      |                   ;
a.cc:25:17: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   25 |  cout << countA(str1) << endl}}
      |                 ^~~~
      |                 |
      |                 std::string {aka std::__cxx11::basic_string<char>}
a.cc:4:18: note:   initializing argument 1 of 'int countA(char*)'
    4 | int countA(char* my_str){
      |            ~~~~~~^~~~~~
Language: C++

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

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

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

Compiler output:
main.c: In function 'main':
main.c:15:53: error: expected ')' before '{' token
   15 |     }else if(((s[1]=='R')&&(s[2]=='S')&&(s[3]=='S')){
      |             ~                                       ^
      |                                                     )
main.c:28:1: error: expected declaration or statement at end of input
   28 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
  char t[3];
  scanf("%s",t);
  int i,count=0,sum=0,pop=0;
  for(i=0;i<3;i++)
  {
   	if(t[i]=='R')
    {
      count++;
    }
    if(t[i]=='S')
    {
      pop=count;
      count=0;
    }
    if(pop>=2)
      sum+=pop;
  }
  printf("%d",sum);

Compiler output:
main.c: In function 'main':
main.c:21:3: error: expected declaration or statement at end of input
   21 |   printf("%d",sum);
      |   ^~~~~~
Language: C

#include<stdio.h>

int main() {
	char wet;
	int i, f=0;
	for (i = 0; i < 3; i++)
	{
		scanf_s("%c", &wet);
		if ((f > 0) && (wet== "S" ))
		{
			break;
		}
		if (wet == 'R')
		{
			f++;
		}
	}
	printf("%d", f);
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |                 scanf_s("%c", &wet);
      |                 ^~~~~~~
      |                 scanf
main.c:9:36: warning: comparison between pointer and integer
    9 |                 if ((f > 0) && (wet== "S" ))
      |                                    ^~
Language: C++

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	
	string s;
	cin >> s;
//	ll len = 0;
//	for(int i = 0; s[i] != '\0'; ++i )
//		len++;
	
	ll cnt = 0;
//	for(int i = 0; i < len; ++i)
//	{
		if(s[0] == 'R' && s[1] == 'R' && s[2] == 'R')
		{
			cnt = 3;
		}
		else if( (s[0] == 'R' && s[1] == 'R' && s[2] == 'S') || (s[0] == 'S' && s[1] == 'R' && s[2] == 'R') )
		{
			cnt = 2;
		}
		else if((s[0] == 'R' && s[1] == 'S' && s[2] == 'R') )
		 cnt = 1;
//	}
	cout << cnt << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'll' was not declared in this scope
   14 |         ll cnt = 0;
      |         ^~
a.cc:19:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |                         cnt = 3;
      |                         ^~~
      |                         int
a.cc:23:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |                         cnt = 2;
      |                         ^~~
      |                         int
a.cc:26:18: error: 'cnt' was not declared in this scope; did you mean 'int'?
   26 |                  cnt = 1;
      |                  ^~~
      |                  int
a.cc:28:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   28 |         cout << cnt << "\n";
      |                 ^~~
      |                 int
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: 's' was not declared in this scope
   18 |       if(s[2] != 'R')
      |          ^
Language: C++

#include <iostream>
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: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected primary-expression before 'RRR'
    8 |   if(S == string RRR){
      |                  ^~~
a.cc:8:17: error: expected ')' before 'RRR'
    8 |   if(S == string RRR){
      |     ~           ^~~~
      |                 )
a.cc:11:24: error: expected primary-expression before 'RRS'
   11 |   else if(S ==  string RRS || S ==  string SRR){
      |                        ^~~
a.cc:11:23: error: expected ')' before 'RRS'
   11 |   else if(S ==  string RRS || S ==  string SRR){
      |          ~            ^~~~
      |                       )
a.cc:14:23: error: expected primary-expression before 'RSR'
   14 |   else if(S == string RSR || S == string SRS || S == string SSR || S == string RSS){
      |                       ^~~
a.cc:14:22: error: expected ')' before 'RSR'
   14 |   else if(S == string RSR || S == string SRS || S == string SSR || S == string RSS){
      |          ~           ^~~~
      |                      )
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s[i]=="R"){
      |        ~~~~^~~~~
a.cc:15:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(s[0]=="R"&&s[1]=="S"&&s[2]=="R"){
      |        ~~~~^~~~~
a.cc:15:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(s[0]=="R"&&s[1]=="S"&&s[2]=="R"){
      |                   ~~~~^~~~~
a.cc:15:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(s[0]=="R"&&s[1]=="S"&&s[2]=="R"){
      |                              ~~~~^~~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
  cin>>s;
  int sum=0;
  for(unsigned long int i=0;i<s.length();i++)
  {
  if(s[i]=='R')
    sum++;
    else
      sum=0;
  ma=max(ma,sum);
  }
cout<<ma;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'ma' was not declared in this scope; did you mean 'fma'?
   14 |   ma=max(ma,sum);
      |   ^~
      |   fma
a.cc:16:7: error: 'ma' was not declared in this scope; did you mean 'fma'?
   16 | cout<<ma;
      |       ^~
      |       fma
Language: C

#include<stdio.h>
int main()
{
    char S[3];
    scanf("%s%s%s",&S[0],&S[1],&S[2]);
    if(S[0]=='r'&&S[1]=='r'&&S[2]=='r')
    {
        printf("3\n");
    }
    if(S[0]=='s'&&S[1]=='s'&&S[2]=='s')
    {
        printf("0\n");
    }
    if(S[0]=='r'&&S[1]=='r'&&S[2]=='s')
    {
        printf("2\n");
    }
    if(S[0]='r'&&S[1]=='s'&&S[2]=='r')
    {
        printf("1\n");
    }

    return 0;





Compiler output:
main.c: In function 'main':
main.c:23:5: error: expected declaration or statement at end of input
   23 |     return 0;
      |     ^~~~~~
Language: Java

import java.util.*;

class Main{
    static Scanner sc = new Scanner(System.in);

    public static void main(String args[]){
        String S=sc.next();
        if(S.equals("RRR")) System.out.println(3);
        else if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("RSR")) System.out.println(1);
      	else if(S.equals("SSS") System.out.println(0);
        else System.out.println(1);
    }
}


Compiler output:
Main.java:10: error: ')' expected
      	else if(S.equals("SSS") System.out.println(0);
      	                       ^
1 error
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
   char S[4];
   int i,j=0;
   scanf("%s",S);
   for(i=0;i<3;i++)
   {
       if(S[i]=='S'||s[i]=='R')
       {
           if(S[i]=='R')
       {
            j++;
       }
       else break;
       }


   }
   printf("%d\n",j);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:22: error: 's' undeclared (first use in this function)
   10 |        if(S[i]=='S'||s[i]=='R')
      |                      ^
main.c:10:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main() {
	char wet;
	int i, f=0;
	for (i = 0; i < 3; i++)
	{
		scanf_s("%c", &wet);
		if ((f > 0) && ("S"== wet))
		{
			break;
		}
		if (wet == 'R')
		{
			f++;
		}
	}
	printf("%d", f);
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |                 scanf_s("%c", &wet);
      |                 ^~~~~~~
      |                 scanf
main.c:9:36: warning: comparison between pointer and integer
    9 |                 if ((f > 0) && ("S"== wet))
      |                                    ^~
Language: C++

#include<iostream>
using namespace std;
int main(){
string s;
  cin>>s;
  int sum=0;
  for(int i=0;i<s.length();i++)
  {
  if(s[i]=='R')
    sum++;
    else
      sum=0;
  ma=max(ma,sum);
  }
cout<<ma;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'ma' was not declared in this scope
   13 |   ma=max(ma,sum);
      |   ^~
a.cc:15:7: error: 'ma' was not declared in this scope
   15 | cout<<ma;
      |       ^~
Language: C++

#include<iostream>
#include<stdio.h>
#include<string.h>
 
using namespace std;
 
int main()
{
   char ch[3];
  cin>>ch;
  int cnt;
  for(int i=0;i<3;++i)
    if(strcmp(ch[i],"R")==0)
      cnt+=1;
  if(cnt==2 && strcmp(ch[2],"R")!=0)
    cout<<cnt-1;
  else
    cout<<cnt;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   13 |     if(strcmp(ch[i],"R")==0)
      |               ~~~~^
      |                   |
      |                   char
In file included from a.cc:3:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:15:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   15 |   if(cnt==2 && strcmp(ch[2],"R")!=0)
      |                       ~~~~^
      |                           |
      |                           char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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




Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: lvalue required as increment operand
    9 |     for (int i = 0 ; i < s.size() ++i)
      |                          ~~~~~~^~
a.cc:9:37: error: expected ';' before 'i'
    9 |     for (int i = 0 ; i < s.size() ++i)
      |                                     ^
      |                                     ;
Language: C++

#include <bits/stdc++.h>

using namespace std;

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




Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: lvalue required as increment operand
    9 |     for (int i = 0 ; i < s.size() ++i)
      |                          ~~~~~~^~
a.cc:9:37: error: expected ';' before 'i'
    9 |     for (int i = 0 ; i < s.size() ++i)
      |                                     ^
      |                                     ;
a.cc:12:40: error: expected ';' before 'else'
   12 |                 c++, ans = max (ans, c)
      |                                        ^
      |                                        ;
   13 |             else
      |             ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int a,j,k;
  j = 0;
  k = 0;
  for(int i = 0;i<3;i++) {
    cin >>S;
    if(S=="R"){
      j++;
    }
    else{
      k++;
      if(j == 1) {
        cout << "1";
    }
  }
  if(j == 3) {
    cout <<"3";
  }
  
      

Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:8:26: note: to match this '{'
    8 |   for(int i = 0;i<3;i++) {
      |                          ^
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: Java

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;



   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:11: 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()
{   int c = 0, ans = 0;
    string s;
    cin >> s;
    for (int i = 0 ; i < s.size(s); ++i)
       {
            if (s[i] == 'R')
                c++, ans = max (ans, c)
            else
                c = 0;
       }
    cout << ans;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(std::string&)'
    9 |     for (int i = 0 ; i < s.size(s); ++i)
      |                          ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:12:40: error: expected ';' before 'else'
   12 |                 c++, ans = max (ans, c)
      |                                        ^
      |                                        ;
   13 |             else
      |             ~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include <string.h>
 
using namespace std;
 
int main()
{
  string str;
  cin>>str;
  int cnt;
  for(int i=0;i<3;++i)
    if(strcmp(str[i],"R")==0)
      cnt+=1;
  if(cnt==2 && strcmp(str[2],"R")!=0)
    cout<<cnt-1;
  else
    cout<<cnt;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   13 |     if(strcmp(str[i],"R")==0)
      |        ~~~~~~^~~~~~~~~~~~
      |              |
      |              __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from a.cc:3:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:15:22: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   15 |   if(cnt==2 && strcmp(str[2],"R")!=0)
      |                ~~~~~~^~~~~~~~~~~~
      |                      |
      |                      __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include <stdio.h>

int main()
{
    char string[3];
    scanf("%s", string);
    int cnt = 0;
    int r = 0;
    int s = 0;

    for (int i = 0; i < 3; i++)
    {
        if (string[i] == 'R')
        {
            r++;
        }
        else if (string[i] == 'S')
        {
            s++;
        }
    }
    if (r == 3)
    {
        printf(3);
    }
    else if (r == 2 && string[2] == 'S')
    {
        printf(2);
    }
    else if (r == 2 && string[2] != 'S')
    {
        printf(1);
    }
    else if (r == 1)
    {
        printf(1);
    }
    else if (s == 3)
    {
        printf(0);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   24 |         printf(3);
      |                ^
      |                |
      |                int
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:28:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   28 |         printf(2);
      |                ^
      |                |
      |                int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:32:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   32 |         printf(1);
      |                ^
      |                |
      |                int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:36:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   36 |         printf(1);
      |                ^
      |                |
      |                int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int k=0;
  int ma;
  for(int i=0;i<3;i++)
  {if(s[i]=='R')
      k++;
   else
     k=0;
   ma=max(ma,k);
  }
  cout<<ma;

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

#include <bits/stdc++.h>

bool comp (int i,int j) { return (i>j); }
using namespace std;
using ll = long long;
ll r,g,b,w;
bool check(ll r, ll g, ll b, ll w)
{
    if (r%2 + g%2 + b%2 + w%2 > 1 ) return false;
    else return true;
}

int main()
{
    string s{3};
    cin>>s;
    while(s)
    {
        int n_R=0,n_S=0;
        for(auto it: s)
            {
                if (it=='R') n_R++;
                else n_S++;
            }
        if(n_R==0) cout<<0<<endl;
        else if(n_R==1) cout<<1<<endl;
        else if(n_R==3) cout<<3<<endl;
        else
            {
                if(s[0]=='S' || s[2]=='S') cout<<2<<endl;
                else cout<<1<<endl;
            }

        cin>>s;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: could not convert 's' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   17 |     while(s)
      |           ^
      |           |
      |           std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include <bits/stdc++.h>

using namespace std;

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




Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected unqualified-id before '=' token
    9 |     for (int char = 0 ; i < s.size(); ++i)
      |                   ^
a.cc:9:18: error: expected ';' before '=' token
    9 |     for (int char = 0 ; i < s.size(); ++i)
      |                  ^~
      |                  ;
a.cc:9:19: error: expected primary-expression before '=' token
    9 |     for (int char = 0 ; i < s.size(); ++i)
      |                   ^
a.cc:9:25: error: 'i' was not declared in this scope
    9 |     for (int char = 0 ; i < s.size(); ++i)
      |                         ^
a.cc:9:37: error: expected ')' before ';' token
    9 |     for (int char = 0 ; i < s.size(); ++i)
      |         ~                           ^
      |                                     )
a.cc:9:41: error: 'i' was not declared in this scope
    9 |     for (int char = 0 ; i < s.size(); ++i)
      |                                         ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected '(' before 'S'
    8 |   if S == "SSS"
      |      ^
      |      (
a.cc:10:6: error: expected '(' before 'S'
   10 |   if S == "RSS"
      |      ^
      |      (
a.cc:12:6: error: expected '(' before 'S'
   12 |   if S == "SRS"
      |      ^
      |      (
a.cc:14:6: error: expected '(' before 'S'
   14 |   if S == "SSR"
      |      ^
      |      (
a.cc:16:6: error: expected '(' before 'S'
   16 |   if S == "RRS"
      |      ^
      |      (
a.cc:18:6: error: expected '(' before 'S'
   18 |   if S == "SRR"
      |      ^
      |      (
a.cc:20:6: error: expected '(' before 'S'
   20 |   if S == "RSR"
      |      ^
      |      (
a.cc:22:6: error: expected '(' before 'S'
   22 |   if S == "RRR"
      |      ^
      |      (
Language: C++

#include<iostream>
#include<stdio.h>

using namespace std;

int main()
{
  string str;
  cin>>str;
  int cnt;
  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:14:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   if(cnt==2 && str[2]!="R")
Language: C++

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

long long main() {
  string s;
  cin >> s;
  long long ans = 0;
  long long  a = 0;
  for(auto c : s) {
    if(c == 'R') {
      ans++;
      a = max(a, ans);
    } else {
      ans = 0;
    }
  }
  cout << a << endl;
  return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
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;
          ren = ren +1;
        }
         else{
        ren = ren +1;
        num = num +1;
      	}
      }
     
    }
    else{
      ren = 1;
      num = 1;
    }
    
    
  }
  else{
    ren = 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:34:3: error: 'else' without a previous 'if'
   34 |   else{
      |   ^~~~
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: In function 'int main()':
a.cc:9:18: error: expected primary-expression before ';' token
    9 |     for (int i = ; i < s.size(); ++i)
      |                  ^
a.cc:13:13: error: 'else' without a previous 'if'
   13 |             else
      |             ^~~~
Language: C++

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

long long main() {
  string s;
  cin >> s;
  long long ans = 0;
  long long  a = 0;
  for(auto c : s) {
    if(c == 'R') {
      ans++;
      a = max(a, ans);
    } else {
      ans = 0;
    }
  }
  cout << a << endl;
  return a;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s;
	int count=1;
	cin>>s;
	for(int i=1;i<s.size();i++)
	{
		if(s[i-1]=='R'&& s[i]=='R')
			count+=1;
		else if(s[i]=='R')
			count=1;RSR
		else
			count=0;
	}
	cout<<count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: 'RSR' was not declared in this scope
   14 |                         count=1;RSR
      |                                 ^~~