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

// Working program with FastReader 
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
  
public class Main 
{ 
    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; 
        } 
    } 
  
    public static void main(String[] args) 
    { 
        FastReader s=new FastReader(); 
      String n=s.nextLine();
      String p="";int c=0;
      for(int i=0;i<3;i++)
      {
        p=n.charAt(i);
        if(p=='R')
          c++;
        else
          c=0;
      }
      System.out.print(c);
    }
}
      
      

Compiler output:
Main.java:74: error: incompatible types: char cannot be converted to String
        p=n.charAt(i);
                  ^
Main.java:75: error: bad operand types for binary operator '=='
        if(p=='R')
            ^
  first type:  String
  second type: char
2 errors
Language: Java

// Working program with FastReader 
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
  
public class Main 
{ 
    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; 
        } 
    } 
  
    public static void main(String[] args) 
    { 
        FastReader s=new FastReader(); 
      String n=s.nextLine();
      String p="";int c=0;
      for(int i=0;i<3;i++)
      {
        p=n.charAt(i);
        if(p=='R')
          c++;
        else
          break;
      }
      System.out.print(c);
    }
}
      
      

Compiler output:
Main.java:74: error: incompatible types: char cannot be converted to String
        p=n.charAt(i);
                  ^
Main.java:75: error: bad operand types for binary operator '=='
        if(p=='R')
            ^
  first type:  String
  second type: char
2 errors
Language: C++

#include <string>
#inlucde <iostream> 

using namespace std;
 
int main() {
  int count = 0;
  int prev = 0;
  string s = "";
  cin >> s;
  for (int i = 0; i < 3; i++) {
  	if (s[i] == 'R') {
      if (prev == 1) count++;
      prev = 1;
    } else {
    	prev = 0;
    }
  }
  return count;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlucde; did you mean #include?
    2 | #inlucde <iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> s;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | #inlucde <iostream>
Language: C++

#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> s;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 |
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s = "";
      |   ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s;
      |   ^~~
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
Language: C++

#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'cin'
    9 |   cin >> s;
      |   ^~~
Language: C++

#include <string>
 
int main() {
  int count = 0;
  int prev = 0;
  string s = ""
  cin >> s;
  for (int i = 0; i < 3; i++) {
  	if (s[i] == 'R') {
      if (prev == 1) count++;
      prev = 1;
    } else {
    	prev = 0;
    }
  }
  return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s = ""
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:13: error: 's' was not declared in this scope
    9 |         if (s[i] == 'R') {
      |             ^
Language: C++

#include <string>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'prev' was not declared in this scope; did you mean 'std::prev'?
    5 |   prev = 0;
      |   ^~~~
      |   std::prev
In file included from /usr/include/c++/14/string:47,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: 'std::prev' declared here
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s = ""
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:13: error: 's' was not declared in this scope
    9 |         if (s[i] == 'R') {
      |             ^
Language: C++

int main() {
	int count = 0;
 	string s = ""
      cin >> s;
  for (int i = 0; i < 3; i++) {
  count += s[i] == "R" ? 1 : 0;
  }
  return count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'string' was not declared in this scope
    3 |         string s = ""
      |         ^~~~~~
a.cc:6:12: error: 's' was not declared in this scope
    6 |   count += s[i] == "R" ? 1 : 0;
      |            ^
Language: Java

public class Main {
    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in);) {
            String s = scanner.next();
            char current = s.charAt(0);
            int counter = 0;

            if (current == 'R') {
                counter++;
            }
            for (int i = 1; i < 3; i++) {
                char next = s.charAt(i);
                if (next == current && next == 'R') {
                    counter++;
                }
                current = next;
            }
            System.out.println(counter);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        try (Scanner scanner = new Scanner(System.in);) {
             ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        try (Scanner scanner = new Scanner(System.in);) {
                                   ^
  symbol:   class Scanner
  location: class Main
2 errors
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) throws IOException {
    
    	Scanner scan = new Scanner(System.in);
    	
    		
    	char [] line = scan.next().toCharArray();
    	int max = 0;
    	int count = 0;
    	
    	for(int i=0; i<3; i++) {
    		if(line[i] == 'R') {
    			count++;
    			if(i == 2) max = Math.max(max, count);
    		} else {
    			max = Math.max(max, count);
    			count = 0;
    		}
    	}
    	System.out.println(max);
    	
    	}
}


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

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

Compiler output:
main.c: In function 'main':
main.c:6:23: error: expected ';' before 'for'
    6 |   if(s[1]=='R')j=1;r=1
      |                       ^
      |                       ;
    7 |   for(i=1;i<3;i++){
      |   ~~~
Language: C

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


Compiler output:
main.c:21:10: error: expected declaration specifiers or '...' before string constant
   21 |   printf("%d",i);
      |          ^~~~
main.c:21:15: error: unknown type name 'i'
   21 |   printf("%d",i);
      |               ^
main.c:22:3: error: expected identifier or '(' before 'return'
   22 |   return 0;
      |   ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:6:23: error: expected ';' before 'for'
    6 |   if(s[1]=='R')j=1;r=1
      |                       ^
      |                       ;
    7 |   for(i=1;i<3;i++){
      |   ~~~                  
main.c: At top level:
main.c:21:10: error: expected declaration specifiers or '...' before string constant
   21 |   printf("%d",i);
      |          ^~~~
main.c:21:15: error: unknown type name 'i'
   21 |   printf("%d",i);
      |               ^
main.c:22:3: error: expected identifier or '(' before 'return'
   22 |   return 0;
      |   ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(s.at(0) == "S"){
      |      ~~~~~~~~^~~~~~
a.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s.at(1) == "R"){
      |        ~~~~~~~~^~~~~~
a.cc:10:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |       if(s.at(2) == "R"){
      |          ~~~~~~~~^~~~~~
a.cc:17:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     else if(s.at(1) == "S"){
      |             ~~~~~~~~^~~~~~
a.cc:18:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |       if(s.at(2) == "R"){
      |          ~~~~~~~~^~~~~~
a.cc:25:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |     else if(s.at(0) == "R"){
      |             ~~~~~~~~^~~~~~
a.cc:26:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |       if(s.at(1) == "R"){
      |          ~~~~~~~~^~~~~~
a.cc:27:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |         if(s.at(2) == "R"){
      |            ~~~~~~~~^~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  cin >> s;
  if(s[1] == 'R'){
    if(s[0] == 'R' && s[2] == 'S'){
      cout << "2\n";
      return 0;
    }
    if(s[0] == 'S' && s[2] == 'R'){
      cout << "2\n";
      return 0;
    }if(s[0] == 'S' && s[2] == 'S'){
      cout << "1\n";
      return 0;
    }
    if(s[0] == 'R' && s[2] == 'R'){
      cout << "3\n";
      return 0;
    }
  }
  if(s[0] == 'R' || s[2] == 

Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: expected primary-expression at end of input
   24 |   if(s[0] == 'R' || s[2] ==
      |                            ^
a.cc:24:28: error: expected ')' at end of input
   24 |   if(s[0] == 'R' || s[2] ==
      |     ~                      ^
      |                            )
a.cc:24:28: error: expected statement at end of input
a.cc:24:28: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
	int x = 0;
	string S;
	cin >> S;
	for (int i = 0; i < 3; i++)
		if (S[i] == "R")
			x += 1;
	if (x == 2)
		if (S[1] == "R")
			cout << "2" << "\n";
		else
			cout << "1" << "\n";
	else
		cout << x << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                 if (S[i] == "R")
a.cc:13:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |                 if (S[1] == "R")
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
	int x = 0:
	string S;
	cin >> S;
	for (int i = 0; i < 3; i++)
		if (S[i] == "R")
			x += 1;
	if (x == 2)
		if (S[1] == "R")
			cout << "2" << "\n";
		else
			cout << "1" << "\n";
	else
		cout << x << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected ',' or ';' before ':' token
    6 |         int x = 0:
      |                  ^
a.cc:8:16: error: 'S' was not declared in this scope
    8 |         cin >> S;
      |                ^
Language: C++

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

int main(){

  string s;
  cin >> s;
  cout<<s;
 
   if(s=="RRR")                           cout<<3<<endl; return 0;
  else if(s=="SRR" || s=="RRS")          cout<<2<<endl; return 0;
  else if(s[0]=="R" || s[1]=="R" || s[2]=="R")    cout<<1<<endl;return 0;
  else cout<<0<<endl;
  
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else if(s=="SRR" || s=="RRS")          cout<<2<<endl; return 0;
      |   ^~~~
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else if(s[0]=="R" || s[1]=="R" || s[2]=="R")    cout<<1<<endl;return 0;
      |   ^~~~
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   else if(s[0]=="R" || s[1]=="R" || s[2]=="R")    cout<<1<<endl;return 0;
a.cc:12:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   else if(s[0]=="R" || s[1]=="R" || s[2]=="R")    cout<<1<<endl;return 0;
a.cc:12:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   else if(s[0]=="R" || s[1]=="R" || s[2]=="R")    cout<<1<<endl;return 0;
a.cc:13:3: error: 'else' without a previous 'if'
   13 |   else cout<<0<<endl;
      |   ^~~~
Language: Java

import java.util.*;

public class A {
	public static void main(String[] args) {
		
		Scanner ob = new Scanner(System.in);
		String patt = ob.next();
		int result = 0;
		
		for(int i = 0; i < patt.length(); i++) {
			int temp = 0;
			for(int j = i; j < patt.length(); j++) {
				if(patt.charAt(j) == 'R'){
					temp++;
				}else {
					break;
				}
			}
			result = Math.max(result, temp);
		}
		System.out.println(result);
		ob.close();
	}

}


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

#include <pch.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
	string S;
	cin >> S;

	int count = 0;

	for (int i = 0; i < 3; i++) {
		if (S.at(i) == 'R') {
			count++;
		}
	}

	if (S.at(0) == S.at(2) && S.at(0) == 'R' && S.at(2) == 'R' && S.at(1) == 'S') {
		count--;
	}

	cout << count << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
 
void solve(std::string S){
    bool s1 = S[0] == 'R';
    bool s2 = S[1] == 'R';
    bool s3 = S[2] == 'R';
    if( s1 && s2 && s3){
      cout << 3 << endl;
    } else if(s2 && (s1 || s3)){
      cout << 2 << endl;
    } else {
      cout << (int) s1 || s2 || s3 << endl;
    }
}
 
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Compiler output:
a.cc: In function 'void solve(std::string)':
a.cc:13:36: error: invalid operands of types 'bool' and '<unresolved overloaded function type>' to binary 'operator<<'
   13 |       cout << (int) s1 || s2 || s3 << endl;
      |                                 ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
void solve(std::string S){
    bool s1 = S[0] == 'R';
    bool s2 = S[1] == 'R';
    bool s3 = S[2] == 'R';
    if( s1 && s2 && s3){
      cout << 3 << endl;
    } else if(s2 && (s1 || s3)){
      cout << 2 << endl;
    } else {
      cout << s1 || s2 || s3 << endl;
    }
}
 
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Compiler output:
a.cc: In function 'void solve(std::string)':
a.cc:13:30: error: invalid operands of types 'bool' and '<unresolved overloaded function type>' to binary 'operator<<'
   13 |       cout << s1 || s2 || s3 << endl;
      |                           ~~~^~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	string s[3];
  	for (int i = 0; i < 3; i++){
    	cin >> s[i];
    }
  if (s == "RRR") {cout << 3 << endl;}
  else if ( s == "SRR" || s == "RRS") {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:9: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
    9 |   if (s == "RRR") {cout << 3 << endl;}
      |       ~~^~~~~~~~
a.cc:10:15: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
   10 |   else if ( s == "SRR" || s == "RRS") {cout << 2 << endl;}
      |             ~~^~~~~~~~
a.cc:10:29: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
   10 |   else if ( s == "SRR" || s == "RRS") {cout << 2 << endl;}
      |                           ~~^~~~~~~~
a.cc:11:15: error: comparison between distinct pointer types 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} and 'const char*' lacks a cast
   11 |   else if ( s == "SSS") {cout << 0 << endl;}
      |             ~~^~~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	string a[3];
  	for (int i = 0; i < 3; i++){
    	cin >> a[i];
    }
  if (s == "RRR") {cout << 3 << endl;}
  else if ( s == "SRR" || s == "RRS") {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:7: error: 's' was not declared in this scope
    9 |   if (s == "RRR") {cout << 3 << endl;}
      |       ^
Language: C

int main(int argc, char *argv[]){
  if(strcmp(argv[0],"RRR")){
    return 3;
  } else if(strcmp(argv[0],"SRR") || strcmp(argv[0],"RRS")){
    return 2;
  } else if(strcmp(argv[0],"SSS")){
    return 0;
  } else {
    return 1;
}

Compiler output:
main.c: In function 'main':
main.c:2:6: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
    2 |   if(strcmp(argv[0],"RRR")){
      |      ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcmp'
  +++ |+#include <string.h>
    1 | int main(int argc, char *argv[]){
main.c:10:1: error: expected declaration or statement at end of input
   10 | }
      | ^
Language: C

int main(int argc, char *argv[]){
  if(strcmp(argv,"RRR")){
    return 3;
  } else if(strcmp(argv,"SRR") || strcmp(argv,"RRS")){
    return 2;
  } else if(strcmp(argv,"SSS")){
    return 0;
  } else {
    return 1;
}

Compiler output:
main.c: In function 'main':
main.c:2:6: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
    2 |   if(strcmp(argv,"RRR")){
      |      ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcmp'
  +++ |+#include <string.h>
    1 | int main(int argc, char *argv[]){
main.c:2:13: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
    2 |   if(strcmp(argv,"RRR")){
      |             ^~~~
      |             |
      |             char **
main.c:2:13: note: expected 'const char *' but argument is of type 'char **'
main.c:4:20: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
    4 |   } else if(strcmp(argv,"SRR") || strcmp(argv,"RRS")){
      |                    ^~~~
      |                    |
      |                    char **
main.c:4:20: note: expected 'const char *' but argument is of type 'char **'
main.c:4:42: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
    4 |   } else if(strcmp(argv,"SRR") || strcmp(argv,"RRS")){
      |                                          ^~~~
      |                                          |
      |                                          char **
main.c:4:42: note: expected 'const char *' but argument is of type 'char **'
main.c:6:20: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
    6 |   } else if(strcmp(argv,"SSS")){
      |                    ^~~~
      |                    |
      |                    char **
main.c:6:20: note: expected 'const char *' but argument is of type 'char **'
main.c:10:1: error: expected declaration or statement at end of input
   10 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#define pi acos(-1)
#define ll long long
#define pii pair<ll,ll>
#define debug(a) cout<<a<<'\n'
#define maxn 200009 /// I wanna be the wind
#define MOD 1000000007
#define F first
#define S second
#define rep(i, a, b) for(ll i = a; i < (b); ++i)
#define per(i, b, a) for(ll i = b-1; i>=a ; i--)
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
using namespace std;
const ll INF = 1e17 + 9;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin>>s;
    ll cont=0;
    ll maior=0;
    rep(i,0,n){
        if(s[i]=='R')cont++;
        else cont=0;
        maior=max(cont,maior);
    }
    cout<<maior<<'\n';
    return 0;  
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'n' was not declared in this scope
   25 |     rep(i,0,n){
      |             ^
a.cc:10:41: note: in definition of macro 'rep'
   10 | #define rep(i, a, b) for(ll i = a; i < (b); ++i)
      |                                         ^
Language: C++

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

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

    if (s[1] == 'S') {cnt = min(1, cnt);SRRSRR }
    cout << cnt << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:41: error: 'SRRSRR' was not declared in this scope
   12 |     if (s[1] == 'S') {cnt = min(1, cnt);SRRSRR }
      |                                         ^~~~~~
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mk make_pair
#define mod 1000000007
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define ff first
#define ss second
#define double long double
#define prec(y,x) fixed<<setprecision(y)<<x
#define inf 1e18
#define pi 3.1415926535

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	string s;
	cin>>s;int ans=0;
	for(int i=0;i<3;i++)
	{
		if(s[i]=='R')
			ans=1;
	}
	for(int i=0;i<2;i++)
	{
		if(s[i]=='R'&&s[i+1]=='R')
			ans=2;
	}
	if(s[0]==s[1]&&s[1]==s[2]&&s[2]=="R")
		ans=3;
	cout<<ans;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:40: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   36 |         if(s[0]==s[1]&&s[1]==s[2]&&s[2]=="R")
Language: Java

import java.util.Scanner;

public class Main5 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long k = sc.nextLong();
		long d = sc.nextLong();
		x=Math.abs(x);
			for (long i = 0; i <= k; i++) {
				if (x <= 0) {
					x += d;
				} else {
					x -= d;
				}
			}
	System.out.println(x);
		}

	}

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

#include <iostream>
using namespace std;
int main(void){
    
    strig s;
    cin >> s;
    int ans;
    if (s == 'RRR') ans = 3;
    if (s == 'RRS') ans = 2;
    if (s == 'RSR') ans = 1;
    if (s == 'RSS') ans = 1;
    if (s == 'SRR') ans = 2;
    if (s == 'SRS') ans = 1;
    if (s == 'SSR') ans = 1;
    if (s == 'SSS') ans = 0;
    cout << ans << endl;
}


Compiler output:
a.cc:8:14: warning: multi-character character constant [-Wmultichar]
    8 |     if (s == 'RRR') ans = 3;
      |              ^~~~~
a.cc:9:14: warning: multi-character character constant [-Wmultichar]
    9 |     if (s == 'RRS') ans = 2;
      |              ^~~~~
a.cc:10:14: warning: multi-character character constant [-Wmultichar]
   10 |     if (s == 'RSR') ans = 1;
      |              ^~~~~
a.cc:11:14: warning: multi-character character constant [-Wmultichar]
   11 |     if (s == 'RSS') ans = 1;
      |              ^~~~~
a.cc:12:14: warning: multi-character character constant [-Wmultichar]
   12 |     if (s == 'SRR') ans = 2;
      |              ^~~~~
a.cc:13:14: warning: multi-character character constant [-Wmultichar]
   13 |     if (s == 'SRS') ans = 1;
      |              ^~~~~
a.cc:14:14: warning: multi-character character constant [-Wmultichar]
   14 |     if (s == 'SSR') ans = 1;
      |              ^~~~~
a.cc:15:14: warning: multi-character character constant [-Wmultichar]
   15 |     if (s == 'SSS') ans = 0;
      |              ^~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'strig' was not declared in this scope
    5 |     strig s;
      |     ^~~~~
a.cc:6:12: error: 's' was not declared in this scope
    6 |     cin >> s;
      |            ^
Language: Java

import java.util.Scanner;
 
public class Main 
{
    public static void main( String[] args )
    {
        try (Scanner scan = new Scanner(System.in)) {
            String input = scan.nextLine();
            int rain = 0, repeat = 0;
            for (char c : input.toCharArray()) {
                if (c == 'R') repeat++;
                else repeat = 0;
                if (rain < repeat) rain = repeat;
            }
            System.out.println(rain);
        }
    }
}
import java.util.Scanner;

public class Main 
{
    public static void main( String[] args )
    {
        try (Scanner scan = new Scanner(System.in)) {
            String input = scan.nextLine();
            int rain = 0, repeat = 0;
            for (char c : input.toCharArray()) {
                if (c == 'R') repeat++;
                else repeat = 0;
                if (rain < repeat) rain = repeat;
            }
            System.out.println(rain);
        }
    }
}


Compiler output:
Main.java:19: error: class, interface, enum, or record expected
import java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;

public class A {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        Solver solverObj = new Solver();
        System.out.println(solverObj.solve(s));
    }
}

class Solver {
    public int solve(String s){
        int max = 0;

        int left = 0;
        for(int i=0;i<s.length();i++){
             char c = s.charAt(i);
             if(c == 'R'){
                 max = Math.max(max, i - left + 1);
             } else {
                 left = i + 1;
             }
        }
        return max;
    }
}


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

#include <iostream>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int count;
  if(S[0] == "S") count++;
  if(S[1] == "S") count++;
  if(S[2] == "S") count++;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(S[0] == "S") count++;
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(S[1] == "S") count++;
a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if(S[2] == "S") count++;
Language: C++

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


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

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

int main() {
  int count = 0;
  string S;
  cin >> S;
  if(S[0]=="S") count++;
  if(S[1]=="S") count++;
  if(S[2]=="S") count++;
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'string' was not declared in this scope
    9 |   string S;
      |   ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin >> S;
      |   ^~~
      |   std::cin
In file included from a.cc:4:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:10: error: 'S' was not declared in this scope
   10 |   cin >> S;
      |          ^
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout << count << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   cout << count << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int count = 0;
  string S;
  cin >> S;
  if(S[0]=="S") count++;
  if(S[1]=="S") count++;
  if(S[2]=="S") count++;
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(S[0]=="S") count++;
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(S[1]=="S") count++;
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if(S[2]=="S") count++;
Language: C++

#include <iostream>
using namespace std;

int main() {
  int count = 0;
  string S;
  cin >> S;
  if(S[0]=="S") count++;
  if(S[1]=="S") count++;
  if(S[2]=="S") count++;
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(S[0]=="S") count++;
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(S[1]=="S") count++;
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if(S[2]=="S") count++;
Language: C++

#include<iostream>
#include<string>

int main() {
  int count = 0;
  string S;
  cin >> S;
  if(S[0]=="S") count++;
  if(S[1]=="S") count++;
  if(S[2]=="S") count++;
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> S;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 'S' was not declared in this scope
    7 |   cin >> S;
      |          ^
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << count;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
#include<string>

int main() {
  int count = 0;
  str S;
  cin >> S;
  if(S[0]=="S") count++;
  if(S[1]=="S") count++;
  if(S[2]=="S") count++;
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |   str S;
      |   ^~~
      |   std
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> S;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 'S' was not declared in this scope
    7 |   cin >> S;
      |          ^
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << count;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

int main() {
  int count = 0;
  string S;
  cin >> S;
  if(S[0]=="S") count++;
  if(S[1]=="S") count++;
  if(S[2]=="S") count++;
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string S;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> S;
      |   ^~~
a.cc:4:10: error: 'S' was not declared in this scope
    4 |   cin >> S;
      |          ^
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'count'?
    8 |   cout << count;
      |   ^~~~
      |   count
Language: C++

#include <bits/stdc++.h>
int main () {
  string S;
  cin >> S;
  if (S == "RRR") puts("3");
  else if (S == "SSS") puts("0");
  else if (S == "RRS" || S == "SRR") puts("2");
  else puts("1");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string S;
      |   ^~~~~~
a.cc:3:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 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/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> S;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:4:10: error: 'S' was not declared in this scope
    4 |   cin >> S;
      |          ^
Language: C++

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: declaration does not declare anything [-fpermissive]
    5 |         long long int   ;
      |                   ^~~
a.cc:7:9: error: expected initializer before 'cin'
    7 |         cin >> S;
      |         ^~~
a.cc:9:12: error: 'S' was not declared in this scope
    9 |         if(S == "RRR") cout << 3 << endl;
      |            ^
Language: C++

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

int main(){
 string s;
  cin>>s;
  int mx =0;
  for(int i=0;i<(int)s.length()-1;i++){
    int cnt =0;
  	if(s[i]=='R'){
    	cnt++;
      	int j = i+1;
        while(j<s.length()){
          if(s[j]=='R'){
            cnt++;
        }
         mx = max(cnt,mx);
    }
  }
  cout<<mx;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: 'max' cannot be used as a function
   17 |          max = max(cnt,max);
      |                ~~~^~~~~~~~~
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: expected ')' before 'n'
    9 |         if(s[i]=='R' n&& s[i+1]=='R') cnt++;
      |           ~         ^~
      |                     )
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
int main(void)
{
    char arr[3];
    scanf("%s",arr);
    if(arr[0]=='R')
    {
        if(arr[1]=='R')
        {
            if(arr[2]=='R')
            {
                printf("3");
            }else{
                printf("2");
            }
        }else{
            if(arr[2]=='R')
            {
                printf("1");
            }else{
                printf("1");
            }
        }
    }else{
        if(arr[1]=='R')
        {
            if(arr[2]=='R')
            {
                printf("2");
            }else{
                printf("1");
            }
        }else{
            if(arr[2]=='R')
            {
                printf("1");
            }else{
                printf("0");
            }
        }
    }
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void)
{
    char arr[3];
    scanf("%s",arr);
    if(arr[0]=='R')
    {
        if(arr[1]=='R')
        {
            if(arr[2]=='R')
            {
                printf("3");
            }else{
                printf("2");
            }
        }else{
            if(arr[2]=='R')
            {
                printf("1");
            }else{
                printf("1");
            }
        }
    }else{
        if(arr[1]=='R')
        {
            if(arr[2]=='R')
            {
                printf("2");
            }else{
                printf("1");
            }
        }else{
            if(arr[2]=='R')
            {
                printf("1");
            }else{
                printf("0");
            }
        }
    }
}


Compiler output:
main.c:52:5: error: redefinition of 'main'
   52 | int main(void)
      |     ^~~~
main.c:6:5: note: previous definition of 'main' with type 'int(void)'
    6 | int main(void)
      |     ^~~~