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

import java.util.Scanner;
public class main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String a = scan.next();
		char b = a.charAt(0);
		char c = a.charAt(1);
		char d = a.charAt(2);
		char f = 'R';
		
		if(b==c && c==d && d==f) {
			
			System.out.println("3");
			
		}else if((b==c && c==f) || (c==d && d==f)) {
			
			System.out.println("2");
			
		}else if(!(b==f || c==f || d==f)) {
			
			System.out.println("0");
			
		}else {
			System.out.println("1");
		}


	}

}

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: C

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

void solve(string s){
	int answer=0,current=0;

	for(int i=0;(unsigned)i<s.size();i++){
		if(s[i] == 'R')
			current++;
		else{
			answer = max(current, answer);
			current = 0;
		}

	}

	cout<<answer;
}


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

	int t=1;

	string s;
	while(t--){
		cin>>s;
		solve(s);
	}

	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;

void solve(string s){
	int answer=0,current=0;

	for(int i=0;(unsigned)i<s.size();i++){
		if(s[i] == 'R')
			current++;
		else{
			answer = max(current, answer);
			current = 0;
		}

	}

	cout<<answer;
}


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

	int t=0;

	string s;
	while(t--){
		cin>>s;
		solve(s);
	}

	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: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;

public class Solution
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }

        int[] readArray(int n, int size){
            int[] a = new int[size];
            for(int i = 0; i < n; i++) {
                a[i] = this.nextInt();
            }

            return a;
        }

        long[] readLongArray(int n, int size){
            long[] a = new long[size];
            for(int i = 0; i < n; i++) {
                a[i] = this.nextLong();
            }
            return a;
        }
    }



    public static void main(String[] args) {
        FastReader s=new FastReader();
        String input = s.next();

        int count = 0;
        int result = count;
        for(int i = 0; i < input.length(); i++) {

            if(input.charAt(i) == 'R') count++;
            else {
                count = 0;
            }

            result = Math.max(result,count);
        }
        System.out.println(count);
    }
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;

public class RainySeason
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }

        int[] readArray(int n, int size){
            int[] a = new int[size];
            for(int i = 0; i < n; i++) {
                a[i] = this.nextInt();
            }

            return a;
        }

        long[] readLongArray(int n, int size){
            long[] a = new long[size];
            for(int i = 0; i < n; i++) {
                a[i] = this.nextLong();
            }
            return a;
        }
    }



    public static void main(String[] args) {
        FastReader s=new FastReader();
        String input = s.next();

        int count = 0;
        int result = count;
        for(int i = 0; i < input.length(); i++) {

            if(input.charAt(i) == 'R') count++;
            else {
                count = 0;
            }

            result = Math.max(result,count);
        }
        System.out.println(count);
    }
}

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

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

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

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

import java.util.Scanner;
class Main
{
  public static void main(String args[])
  
    int c,i;
    Scanner sc = new Scanner(System.in);
    String s=sc.next();
    c=0;
    String str [] = s.split("S",-1);
    for(i=0;i<str.length;i++)
    {
      if(str[i].length()>c)
      c=str[i].length();
    }
    System.out.println(c);
  }
}
import java.util.Scanner;
class Main
{
  public static void main(String args[])
  {
    int c,i;
    Scanner sc = new Scanner(System.in);
    String s=sc.next();
    c=0;
    String str [] = s.split("S",-1);
    for(i=0;i<str.length;i++)
    {
      if(str[i].length()>c)
      c=str[i].length();
    }
    System.out.println(c);
  }
}


Compiler output:
Main.java:4: error: ';' expected
  public static void main(String args[])
                                        ^
Main.java:9: error: <identifier> expected
    c=0;
     ^
Main.java:11: error: illegal start of type
    for(i=0;i<str.length;i++)
    ^
Main.java:11: error: <identifier> expected
    for(i=0;i<str.length;i++)
         ^
Main.java:11: error: > or ',' expected
    for(i=0;i<str.length;i++)
                        ^
Main.java:11: error: <identifier> expected
    for(i=0;i<str.length;i++)
                          ^
Main.java:16: error: <identifier> expected
    System.out.println(c);
                      ^
Main.java:16: error: <identifier> expected
    System.out.println(c);
                        ^
Main.java:18: error: class, interface, enum, or record expected
}
^
9 errors
Language: Java

import java.util.Scanner;
class Main
{
  public static void main(String args[])
  
    int c,i;
    Scanner sc = new Scanner(System.in);
    String s=sc.next();
    c=0;
    String str [] = s.split("S",-1);
    for(i=0;i<str.length;i++)
    {
      if(str[i].length()>c)
      c=str[i].length();
    }
    System.out.println(c);
  }
}

Compiler output:
Main.java:4: error: ';' expected
  public static void main(String args[])
                                        ^
Main.java:9: error: <identifier> expected
    c=0;
     ^
Main.java:11: error: illegal start of type
    for(i=0;i<str.length;i++)
    ^
Main.java:11: error: <identifier> expected
    for(i=0;i<str.length;i++)
         ^
Main.java:11: error: > or ',' expected
    for(i=0;i<str.length;i++)
                        ^
Main.java:11: error: <identifier> expected
    for(i=0;i<str.length;i++)
                          ^
Main.java:16: error: <identifier> expected
    System.out.println(c);
                      ^
Main.java:16: error: <identifier> expected
    System.out.println(c);
                        ^
Main.java:18: error: class, interface, enum, or record expected
}
^
9 errors
Language: Java

import java.util.Scanner;
public class sol
{
  public static void main(String args[])
  {
    int c,i;
    String s=sc.next();
    c=0;
    String str [] = s.split('S',-1);
    for(i=0;i<str.length;i++)
    {
      if(str[i].length()>c)
      c=str[i].length();
    }
    System.out.println(c);
  }
}

Compiler output:
Main.java:2: error: class sol is public, should be declared in a file named sol.java
public class sol
       ^
Main.java:7: error: cannot find symbol
    String s=sc.next();
             ^
  symbol:   variable sc
  location: class sol
Main.java:9: error: incompatible types: char cannot be converted to String
    String str [] = s.split('S',-1);
                            ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
 char s[10];
    cin >> s;
    int ans = 0;
    for(int i = 0;i <strlen(s);i++) {
        int k = 0;
        if (s[i] == 'R') {
            for(int j = i;s[j] == 'R';j++) {
                k++;
            }
            if(ans < k) ans = k;
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'strlen' was not declared in this scope
    9 |     for(int i = 0;i <strlen(s);i++) {
      |                      ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C

import java.util.*;

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

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class Main {
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    3 | public class Main {
      |              ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1000000000000000000

using namespace std;

string ans(string s){
  switch (s) {
    case "SSS" : return 0;
    case "SSR" : return 1;
    case "SRS" : return 1;
    case "SRR" : return 2;
    case "RSS" : return 1;
    case "RSR" : return 1;
    case "RRS" : return 2;
    case "RRR" : return 3;
  }
}

int main(void){
  string s;
  cin >> s;
  
  cout << ans(s) << endl;

  return 0;
}


Compiler output:
a.cc: In function 'std::string ans(std::string)':
a.cc:9:11: error: switch quantity not an integer
    9 |   switch (s) {
      |           ^
a.cc:11:25: error: could not convert '1' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   11 |     case "SSR" : return 1;
      |                         ^
      |                         |
      |                         int
a.cc:12:25: error: could not convert '1' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   12 |     case "SRS" : return 1;
      |                         ^
      |                         |
      |                         int
a.cc:13:25: error: could not convert '2' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   13 |     case "SRR" : return 2;
      |                         ^
      |                         |
      |                         int
a.cc:14:25: error: could not convert '1' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   14 |     case "RSS" : return 1;
      |                         ^
      |                         |
      |                         int
a.cc:15:25: error: could not convert '1' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   15 |     case "RSR" : return 1;
      |                         ^
      |                         |
      |                         int
a.cc:16:25: error: could not convert '2' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   16 |     case "RRS" : return 2;
      |                         ^
      |                         |
      |                         int
a.cc:17:25: error: could not convert '3' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   17 |     case "RRR" : return 3;
      |                         ^
      |                         |
      |                         int
Language: C++

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

int main() {
  string str;
  cin >> str;}
 
int countR(string str) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if("R" == str.substr(i,1)){
  k = k+1;}
  cout << k << endl;}


 
 if( countR(str)==2 ){
 if("R" == str.substr(1,1) ){
 cout << 2 << endl;}
 else{
 cout << 1 << endl;};
}
 else{
 cout << countR(str) << endl;}


Compiler output:
a.cc: In function 'int countR(std::string)':
a.cc:25:31: error: expected '}' at end of input
   25 |  cout << countR(str) << endl;}
      |                               ^
a.cc:8:24: note: to match this '{'
    8 | int countR(string str) {
      |                        ^
a.cc:25:31: warning: no return statement in function returning non-void [-Wreturn-type]
   25 |  cout << countR(str) << endl;}
      |                               ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected '}' at end of input
   14 |   else{ cout << "0" << endl;}
      |                              ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  string str;
  cin >> str;}
 
int countR(string str) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if("R" == str.substr(i,1)){
  k = k+1;}
  cout << k << endl;}
 
;}

 
 if( countR(str)==2 ){
 if("R" == str.substr(1,1) ){
 cout << 2 << endl;}
 else{
 cout << 1 << endl;};
}
 else{
 cout << countR(str) << endl;}


Compiler output:
a.cc: In function 'int countR(std::string)':
a.cc:16:2: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | ;}
      |  ^
a.cc: At global scope:
a.cc:19:2: error: expected unqualified-id before 'if'
   19 |  if( countR(str)==2 ){
      |  ^~
a.cc:25:2: error: expected unqualified-id before 'else'
   25 |  else{
      |  ^~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
 char s[10];
    cin >> s;
    int ans = 0;
    for(int i = 0;i <strlen(s);i++) {
        int k = 0;
        if (s[i] == 'R') {
            for(int j = i;s[j] == 'R';j++) {
                k++;
                j++;
            }
            ans = max(ans, k);
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'strlen' was not declared in this scope
    9 |     for(int i = 0;i <strlen(s);i++) {
      |                      ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        long X = sc.nextInt();
        // スペース区切りの整数の入力
        long K = sc.nextInt();
        long D = sc.nextInt();
 
		long Y;
		long A;
		long YY;
		long AA;
        long Z;
      
		for(long i=1;i<K+1;K++){
        	YY=X+i*D-(K-i)*D;
            AA=Math.abs(YY);
        	Y=X+(i-1)*D-(K-(i-1))*D;
            A=Math.abs(Y);
            
            if(AA<A){
            	Z=AA;
            }
        }      
      
        // 出力
        System.out.println(Z);
    }
}


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

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

int main() {
  string str0;
  cin >> str0;}
 
int countR(string x) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if("R" == x[i]){
  k = k+1;}
  cout << k << endl;}
 
;}

 
 if( countR(str0)==2 ){
 if("R" == str0[1] ){
 cout << 2 << endl;}
 else{
 cout << 1 << endl;};
}
 else{
 cout << countR(str0) << endl;}


Compiler output:
a.cc: In function 'int countR(std::string)':
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if("R" == x[i]){
a.cc:16:2: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | ;}
      |  ^
a.cc: At global scope:
a.cc:19:2: error: expected unqualified-id before 'if'
   19 |  if( countR(str0)==2 ){
      |  ^~
a.cc:25:2: error: expected unqualified-id before 'else'
   25 |  else{
      |  ^~~~
Language: C++

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

int main() {
  string str0[];
  cin >> str0[];};
 
int countR(string x[]) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if("R" == x[i]){
  k = k+1; }
  cout << k << endl}
 
}

 
 if( countR(str0[])==2 ){
 if("R" == str0[1] ){
 cout << 2 << endl;}
 else{
 cout << 1 << endl}
}
 else{
 cout << countR(str0[]) << endl;};


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: array size missing in 'str0'
    5 |   string str0[];
      |          ^~~~
a.cc:6:15: error: expected primary-expression before ']' token
    6 |   cin >> str0[];};
      |               ^
a.cc: In function 'int countR(std::string*)':
a.cc:14:20: error: expected ';' before '}' token
   14 |   cout << k << endl}
      |                    ^
      |                    ;
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
a.cc: At global scope:
a.cc:19:2: error: expected unqualified-id before 'if'
   19 |  if( countR(str0[])==2 ){
      |  ^~
a.cc:25:2: error: expected unqualified-id before 'else'
   25 |  else{
      |  ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  string str ;
  getline(cin,str);
  int n= str.length() ; 
  if(str[1]=='S'){
    if(str[0]=='R' || str[2]=='R'){
      cout<<1;
    }
   if(str[1]=='R'){
     if(str[0]=='R' && str[2]=='R'){
      cout<<3;
      }
     if((str[0]=='R' && str[2]!='R')||(str[0]!='R' && str[2]=='R')){
       cout<<2;
     }
     if(str[0]!='R' && str[2]!='R'){
      cout<<1;
      }
   }
        
}                                      
                                       
    
      


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

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

int main()
{
    char s[5],r;
    int len,i,count,j;

    for(j=0;i<3;j++)
    {
        scanf("%c",&S[i]);
    }

    len = strlen(s);

    for(i=0,count=0;i<len;i++)
    {
        if(i==0)
        {
            if(s[i]=='R')
            {
            count++;
            }
            r = s[i];
        }

        else
        {
            if(s[i]=='R' && r=='R')
            {
            count++;
            }
            r = s[i];
        }
    }

    printf("%d",count);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:21: error: 'S' undeclared (first use in this function)
   11 |         scanf("%c",&S[i]);
      |                     ^
main.c:11:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  string str0;
  cin >> str0;};
 
int countR(string x) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if("R" == x[i]){
  k = k+1; }
  cout << k << endl}
 
}

 
 if( countR(str0)==2 ){
 if("R" == str0[1] ){
 cout << 2 << endl;}
 else{
 cout << 1 << endl}
}
 else{
 cout << countR(str0) << endl;};


Compiler output:
a.cc: In function 'int countR(std::string)':
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if("R" == x[i]){
a.cc:14:20: error: expected ';' before '}' token
   14 |   cout << k << endl}
      |                    ^
      |                    ;
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
a.cc: At global scope:
a.cc:19:2: error: expected unqualified-id before 'if'
   19 |  if( countR(str0)==2 ){
      |  ^~
a.cc:25:2: error: expected unqualified-id before 'else'
   25 |  else{
      |  ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  string str ;
  getline(cin,str);
  int n= str.length() ; 
  if((str[1]=='S'){
    if(str[0]=='R' || str[2]=='R'){
      cout<<1;
    }
   if(str[1]=='R'){
     if(str[0]=='R' && str[2]=='R'){
      cout<<3;
      }
     if((str[0]=='R' && str[2]!='R')||(str[0]!='R' && str[2]=='R')){
       cout<<2;
     }
     if(str[0]!='R' && str[2]!='R'){
      cout<<1;
      }
        
}                                      
                                       
    
      


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ')' before '{' token
    8 |   if((str[1]=='S'){
      |     ~             ^
      |                   )
a.cc:23:2: error: expected statement at end of input
   23 | }
      |  ^
a.cc:23:2: error: expected '}' at end of input
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>

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];
    char R;
    char S;
    string RSR;

    scanf("%s", str);

    if(str ==RSR){
     printf("1");
     
    }else if (str ==RSR){
      printf("%d\n", str_chnum(str, R));
    }
    
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'string' was not declared in this scope
   24 |     string RSR;
      |     ^~~~~~
a.cc:24:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:28:14: error: 'RSR' was not declared in this scope
   28 |     if(str ==RSR){
      |              ^~~
Language: C++

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

int main() {
  string c;
  int S, a=0, b=0, i;
  cin >> S;
  cin >> c;
  
  for(int i=0; i<N; i++) {
    if(c[i] == 'S')a++;
  }
  if(a==0||b==S)cout << 0;
  else {
    for(int i=0; i<N; i++) {
      if(c[i] == 'R')b++;
    }
    cout << a;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'N' was not declared in this scope
   10 |   for(int i=0; i<N; i++) {
      |                  ^
a.cc:15:20: error: 'N' was not declared in this scope
   15 |     for(int i=0; i<N; i++) {
      |                    ^
Language: C++

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

int main() {
  string str0;
  cin >> str0;};
 
int countR(string x) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if("R" == x[i]){
  k = k+1; }
  cout << k << endl;}
 
}

 
if( countR(str0)==2 ){
 if("R" == str0[1] ){
 cout << 2 << endl;}
 else{
 cout << 1 << endl;}
};
else{
 cout << countR(str0) << endl;};


Compiler output:
a.cc: In function 'int countR(std::string)':
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if("R" == x[i]){
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^
a.cc: At global scope:
a.cc:19:1: error: expected unqualified-id before 'if'
   19 | if( countR(str0)==2 ){
      | ^~
a.cc:25:1: error: expected unqualified-id before 'else'
   25 | else{
      | ^~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  int i;
  char c = s.at(i);
  
  if(s.at(0) == s.at(1) == s.at(2) == "R"){
    cout << 3 << endl;
  }
  else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
    cout << 2 << endl;
  }
  else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
    cout << 1 << endl;
  }
  else{
    cout << 0 << endl;
  }
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if(s.at(0) == s.at(1) == s.at(2) == "R"){
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:13:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
      |           ~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:13:59: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
      |                                        ~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:16:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |           ~~~~~~~~^~~~~~
a.cc:16:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |                             ~~~~~~~~^~~~~~
a.cc:16:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |                                               ~~~~~~~~^~~~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  char c = s.at(i);
  
  if(s.at(0) == s.at(1) == s.at(2) == "R"){
    cout << 3 << endl;
  }
  else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
    cout << 2 << endl;
  }
  else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
    cout << 1 << endl;
  }
  else{
    cout << 0 << endl;
  }
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'i' was not declared in this scope
    7 |   char c = s.at(i);
      |                 ^
a.cc:9:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(s.at(0) == s.at(1) == s.at(2) == "R"){
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:12:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
      |           ~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:12:59: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
      |                                        ~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:15:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |           ~~~~~~~~^~~~~~
a.cc:15:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |                             ~~~~~~~~^~~~~~
a.cc:15:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |                                               ~~~~~~~~^~~~~~
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: 'i' was not declared in this scope
    7 |         if(s[0] == 'S' && s[i] == 'R' && s[i] == 'R'){
      |                             ^
Language: C++

#include<bits/stdc++.h>


using namespace std;

typedef long long ll;
const double eps = 1e-9;



int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    map<string,int>m;
    m["RRS"]=2;
    m["SRR"]=2;
    m["RSR"]=1;
    m["SRS"]=1;
    m["RSS"]=1;
    m["SSR"]=1
    m["RRR"]=1
    string s;
    cin>>s;
    cout<<m[s]<<endl;



}

/*
 ll x,k,d;
    cin>>x>>k>>d;
    if(x==0)
    {
        if(k%2)
        {
            cout<<x+d<<endl;;
        }
        else
        {
            cout<<0<<endl;
        }
    }
    else if(x>0)
    {
        if(x-k*d>=0)
        {
            cout<<x-k*d<<endl;
        }
        else
        {
           ll moves = x/d;
            ll ans;
            if((k-moves) % 2 == 0)
            {
                ans = x-moves*d;

            }
            else
            {
                ans = llabs(x-moves*d - d);
            }
            cout<<ans<<endl;

        }


    }
    else if(x<0)
    {
        if(x+k*d<=0)
        {
            cout<<x+k*d<<endl;
        }
        else
        {
           ll moves = x/d * -1;
            ll ans;
            if((k-moves) % 2 == 0)
            {
                ans = x+moves*d;

            }
            else
            {
                ans = llabs(x+moves*d + d);
            }
            cout<<ans<<endl;

        }
    }

*/


Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: expected ';' before 'm'
   22 |     m["SSR"]=1
      |               ^
      |               ;
   23 |     m["RRR"]=1
      |     ~          
a.cc:25:10: error: 's' was not declared in this scope
   25 |     cin>>s;
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int a=0;
char S[3];
gets(S);
for(int i=0;i<3;i++)
    {
        if(S[i]=='R')
            a++;
    }
cout<<a<<endl;
 
return 0;
}

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

import java.util.*;
import java.io.*;
public class Problem{
 static Scanner sc = new Scanner(System.in); 
public static void main(String[] argh){
  String[] str = sc.nextLine().split("");
  int count = 0;
  for(String s : str){
    if(s.equals("R"))count++;
}
  System.out.println(count);
}
}

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

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

int main() {
  string str0;
  cin >> str0;};
 
int countR(string x) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if("R" == x[i]){
  k = k+1; }
  cout << k << endl;}
 
};

 
if( countR(str0)==2 ){
 if("R" == str0[1] ){
 cout << 2 << endl;}
 else{
 cout << 1 << endl;}
}
else{
 cout << countR(str0) << endl;};


Compiler output:
a.cc: In function 'int countR(std::string)':
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if("R" == x[i]){
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | };
      | ^
a.cc: At global scope:
a.cc:19:1: error: expected unqualified-id before 'if'
   19 | if( countR(str0)==2 ){
      | ^~
a.cc:25:1: error: expected unqualified-id before 'else'
   25 | else{
      | ^~~~
Language: Java

import java.util.*;
import java.io.*;
public class Problem{
 static Scanner sc = new Scanner(System.in); 
public static void main(String[] argh){
  String[] str = sc.nextLine().split("");
  int count = 0;
  for(String s : str){
    if(s.equals("R"))count++;
}
  System.out.println(count);
}

Compiler output:
Main.java:12: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

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

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

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

  if (S == "RSS" || S == "SRS" || S == "SSR" || S == "RSR") {
    cout << 1 << endl;
  }
  
  if (S == "SSS") {
    cout << 0 << endl;
  }

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

#include<iostream>
using namespace std;

int main(){
    int a=0;
char S[3];
gets(S);
for(int i=0;i<3;i++)
    {
        if(S[i]=='R')
            a++;
    }
cout<<a<<endl;

return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
 char a[3];
 int i;
 
 for(i=0;i<3;i++){
   cin >> a[i];
 }
 
 if(a[0]=="R"&&a[1]=="S"){cout<< 1 <<endl;}
 else if(a[0]=="R"&&a[1]=="R"&&a[2]=="S"){cout<<2<<endl;}
 else if(a[0]=="R"&&a[1]=="R"&&a[2]=="R"){cout<<3<<endl;}
 else if(a[0]=="S"&&a[1]=="S"&&a[2]=="R"){cout<<1<<endl;}
 else if(a[0]=="S"&&a[1]=="R"&&a[2]=="R"){cout<<2<<endl;}
 else{cout<<0<<endl;}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |  if(a[0]=="R"&&a[1]=="S"){cout<< 1 <<endl;}
      |     ~~~~^~~~~
a.cc:11:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |  if(a[0]=="R"&&a[1]=="S"){cout<< 1 <<endl;}
      |                ~~~~^~~~~
a.cc:12:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |  else if(a[0]=="R"&&a[1]=="R"&&a[2]=="S"){cout<<2<<endl;}
      |          ~~~~^~~~~
a.cc:12:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |  else if(a[0]=="R"&&a[1]=="R"&&a[2]=="S"){cout<<2<<endl;}
      |                     ~~~~^~~~~
a.cc:12:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |  else if(a[0]=="R"&&a[1]=="R"&&a[2]=="S"){cout<<2<<endl;}
      |                                ~~~~^~~~~
a.cc:13:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |  else if(a[0]=="R"&&a[1]=="R"&&a[2]=="R"){cout<<3<<endl;}
      |          ~~~~^~~~~
a.cc:13:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |  else if(a[0]=="R"&&a[1]=="R"&&a[2]=="R"){cout<<3<<endl;}
      |                     ~~~~^~~~~
a.cc:13:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |  else if(a[0]=="R"&&a[1]=="R"&&a[2]=="R"){cout<<3<<endl;}
      |                                ~~~~^~~~~
a.cc:14:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |  else if(a[0]=="S"&&a[1]=="S"&&a[2]=="R"){cout<<1<<endl;}
      |          ~~~~^~~~~
a.cc:14:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |  else if(a[0]=="S"&&a[1]=="S"&&a[2]=="R"){cout<<1<<endl;}
      |                     ~~~~^~~~~
a.cc:14:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |  else if(a[0]=="S"&&a[1]=="S"&&a[2]=="R"){cout<<1<<endl;}
      |                                ~~~~^~~~~
a.cc:15:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |  else if(a[0]=="S"&&a[1]=="R"&&a[2]=="R"){cout<<2<<endl;}
      |          ~~~~^~~~~
a.cc:15:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |  else if(a[0]=="S"&&a[1]=="R"&&a[2]=="R"){cout<<2<<endl;}
      |                     ~~~~^~~~~
a.cc:15:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |  else if(a[0]=="S"&&a[1]=="R"&&a[2]=="R"){cout<<2<<endl;}
      |                                ~~~~^~~~~
Language: C++

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

int main()
{
    char s[4];
    cin>>s;
    int c=1;
    int m=1;
    if(s[0]==s[1] && s[1]==s[2] && s[0]=='R') cout<<3<<endl;
    else if(s[0]==s[1] && s[0]=='R') cout<<2<<endl;
    //else if(s[0]==s[2] && s[0]=='R') cout<<2<<endl;
    else if(s[1]==s[2] && s[0]=='R') cout<<2<<endl;
    else if(s[0]==s[1] && s[1]==s[2] && s[0]=='S') cout<<0<<endl;
    else cout<<1<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: expected '}' at end of input
   15 |     else cout<<1<<endl;
      |                        ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

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

int main() {
  string str0;
  cin >> str0;};
 
int countR(string str0) {
 
for (int i = 0; i < 3; i++) {
  int k;
  if(!strcmp(str0[i], "R")){
  k = k+1; }
  cout << k << endl;}
 
};

 
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:12:13: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   12 |   if(!strcmp(str0[i], "R")){
      |       ~~~~~~^~~~~~~~~~~~~~
      |             |
      |             __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/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:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | };
      | ^
a.cc: At global scope:
a.cc:19:1: error: expected unqualified-id before 'if'
   19 | if( countR(str0)==2 ){
      | ^~
a.cc:25:1: error: expected unqualified-id before 'else'
   25 | else{
      | ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'e' was not declared in this scope
   21 |                 e++;
      |                 ^
a.cc:23:15: error: 'e' was not declared in this scope
   23 |               e=1;
      |               ^
a.cc:26:15: error: 'e' was not declared in this scope
   26 |         cout<<e<<endl;
      |               ^
Language: C++

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

int main() {
  string s;
  cin >> s;
  
  if(s.at(0) == s.at(1) == s.at(2) == "R"){
    cout << 3 << endl;
  }
  else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
    cout << 2 << endl;
  }
  else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
    cout << 1 << endl;
  }
  else{
    cout << 0 << endl;
  }
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(s.at(0) == s.at(1) == s.at(2) == "R"){
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:11:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
      |           ~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:11:59: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   else if(s.at(0) == s.at(1) == "R" || s.at(1) == s.at(2) == "R"){
      |                                        ~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |           ~~~~~~~~^~~~~~
a.cc:14:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |                             ~~~~~~~~^~~~~~
a.cc:14:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   else if(s.at(0) == "R" || s.at(1) == "R" || s.at(2) == "R"){
      |                                               ~~~~~~~~^~~~~~
Language: C++

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

#define int long long

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

	string str;
	cin>>str;
	int count = 0;

	
	if(str[0] == 'R' and str[1] == 'R' and str[2] =='R'){
		count += 3;
	}
	if(str[0] == 'R' and str[1] == 'R' and str[2] == 'S'){
		count += 2;
	}

	if(str[0] == 'R' and str[2] == 'R' and str[1] == 'S'){
		count += 1;
	}
	if(str[i+1] =='R' and str[2] == 'R' and str[0] == 'S'){
		count += 2;
	}
		
	cout<<count;

	return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:25:16: error: 'i' was not declared in this scope
   25 |         if(str[i+1] =='R' and str[2] == 'R' and str[0] == 'S'){
      |                ^
Language: C++

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

int main()

{
    char S[3];

    int len,i,cnt = 0;

    gets(S);

    len = strlen(S);

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

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

    printf("%d",cnt);


}


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

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

int main()
{
    char s[5],r;
    int len,i,count;

    gets(s);

    len = strlen(s);

    for(i=0,count=0;i<len;i++)
    {
        if(i==0)
        {
            if(s[i]=='R')
            {
            count++;
            }
            r = s[i];
        }

        else
        {
            if(s[i]=='R' && r=='R')
            {
            count++;
            }
            r = s[i];
        }
    }

    printf("%d",count);

    return 0;
}


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

#include <iostream>
using namespace std;
int main()
{
  string str ;
  getline(cin,str);
  int n= str.length() ;
  if(str[0]=='R' && str[1] =='R' && str[2]=='R')
                                        cout<<3;
  if((str[0]=='R' && str[1] =='R' && str[2]!='R')||(str[0]!='R' && str[1] =='R' && str[2]=='R'))
                                        cout<<2;
 if(str[0]=='R' && str[1] !='R' && str[2]=='R')||(str[0]!='R' && str[1] !='R' && str[2]=='R')||(str[0]=='R' && str[1] !='R' && str[2]!='R')||(str[0]!='R' && str[1] =='R' && str[2]!='R'))
                                       cout<<1;
         
}                                      
                                       
    
      


Compiler output:
a.cc: In function 'int main()':
a.cc:12:48: error: expected primary-expression before '||' token
   12 |  if(str[0]=='R' && str[1] !='R' && str[2]=='R')||(str[0]!='R' && str[1] !='R' && str[2]=='R')||(str[0]=='R' && str[1] !='R' && str[2]!='R')||(str[0]!='R' && str[1] =='R' && str[2]!='R'))
      |                                                ^~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  string str ;
  getline(cin,str);
  int n= str.length() ;
  if(str[0]=='R' && str[1] =='R' && str[2]=='R')
                                        cout<<3;
  if((str[0]=='R' && str[1] =='R' && str[2]!='R')||(str[0]!='R' && str[1] =='R' && str[2]=='R'))
                                        cout<<2;
 if(str[0]=='R' && str[1] !='R' && str[2]=='R')||(str[0]!='R' && str[1] !='R' && str[2]=='R')||(str[0]=='R' && str[1] !='R' && str[2]!='R')||(str[0]!='R' && str[1] =='R' && str[2]!='R')
                                       cout<<1;
         
}                                      
                                       
    
      


Compiler output:
a.cc: In function 'int main()':
a.cc:12:48: error: expected primary-expression before '||' token
   12 |  if(str[0]=='R' && str[1] !='R' && str[2]=='R')||(str[0]!='R' && str[1] !='R' && str[2]=='R')||(str[0]=='R' && str[1] !='R' && str[2]!='R')||(str[0]!='R' && str[1] =='R' && str[2]!='R')
      |                                                ^~