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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
using Graph = vector<vector<int>>;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;

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

Compiler output:
a.cc:5:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    5 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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

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

    return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ')' before ';' token
    7 |   if(s[0]=='R';s[1]=='R';s[2]=='R') x=3;
      |     ~                   ^
      |                         )
a.cc:7:35: error: expected ';' before ')' token
    7 |   if(s[0]=='R';s[1]=='R';s[2]=='R') x=3;
      |                                   ^
      |                                   ;
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else if(s[0]=='S';s[1]=='R';s[2]=='R') x=2;
      |   ^~~~
a.cc:8:30: error: expected ')' before ';' token
    8 |   else if(s[0]=='S';s[1]=='R';s[2]=='R') x=2;
      |          ~                   ^
      |                              )
a.cc:8:40: error: expected ';' before ')' token
    8 |   else if(s[0]=='S';s[1]=='R';s[2]=='R') x=2;
      |                                        ^
      |                                        ;
a.cc:9:3: error: 'else' without a previous 'if'
    9 |   else if(s[0]=='R';s[1]=='R';s[2]=='S') x=1;
      |   ^~~~
a.cc:9:30: error: expected ')' before ';' token
    9 |   else if(s[0]=='R';s[1]=='R';s[2]=='S') x=1;
      |          ~                   ^
      |                              )
a.cc:9:40: error: expected ';' before ')' token
    9 |   else if(s[0]=='R';s[1]=='R';s[2]=='S') x=1;
      |                                        ^
      |                                        ;
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else if(s[0]=='R';s[1]=='s';s[2]=='R') x=1;
      |   ^~~~
a.cc:10:30: error: expected ')' before ';' token
   10 |   else if(s[0]=='R';s[1]=='s';s[2]=='R') x=1;
      |          ~                   ^
      |                              )
a.cc:10:40: error: expected ';' before ')' token
   10 |   else if(s[0]=='R';s[1]=='s';s[2]=='R') x=1;
      |                                        ^
      |                                        ;
a.cc:11:3: error: 'else' without a previous 'if'
   11 |   else if(s[0]=='S';s[1]=='S';s[2]=='S') x=0;
      |   ^~~~
a.cc:11:30: error: expected ')' before ';' token
   11 |   else if(s[0]=='S';s[1]=='S';s[2]=='S') x=0;
      |          ~                   ^
      |                              )
a.cc:11:40: error: expected ';' before ')' token
   11 |   else if(s[0]=='S';s[1]=='S';s[2]=='S') x=0;
      |                                        ^
      |                                        ;
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else x=1;
      |   ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <math.h>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
string s;
int main()
{
    cin>>s;
    int ans=1;
    if(s=="SSS")ans=0;
    if(s=="RRS"||s=="SRR")ans=2;
    if(s==RSR"RRR")ans=3;
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 'RSR' was not declared in this scope
   20 |     if(s==RSR"RRR")ans=3;
      |           ^~~
a.cc:20:14: error: expected ')' before string constant
   20 |     if(s==RSR"RRR")ans=3;
      |       ~      ^~~~~
      |              )
Language: C++

/*
    Author: MEHXM
*/
#include <iostream>
using namespace std;

#define cp_io ios_base::sync_with_stdio(0);cin.tie(0)
#define ll long long int
#define oo 1000000010
#define MAX 1000000
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define nl "\n"

int main()
{
    cp_io;
    #ifndef ONLINE_JUDGE
    freopen("z_input.txt","rt",stdin);
    freopen("z_output.txt","wt",stdout);
    #endif
    string s;
    cin >> s;
    int ans = INT_MIN,c=0;
    for(int i=0; i<3; i++)
    {
        if(s[i]=='R')
        {
            c = 0;
            while(s[i]=='R' && i<3){
                i++;
                c++;
            }
        }
        ans = max(ans, c);
    }
    cout << ans << nl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: 'INT_MIN' was not declared in this scope
   26 |     int ans = INT_MIN,c=0;
      |               ^~~~~~~
a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <iostream>
  +++ |+#include <climits>
    5 | using namespace std;
a.cc:31:13: error: 'c' was not declared in this scope
   31 |             c = 0;
      |             ^
a.cc:37:24: error: 'c' was not declared in this scope
   37 |         ans = max(ans, c);
      |                        ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:10:6: error: break statement not within loop or switch
   10 | else break;
      |      ^~~~~
main.c:12:6: error: break statement not within loop or switch
   12 | else break;
      |      ^~~~~
Language: C

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

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

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

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

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

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

    return 0;
}

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

s=input()
if "RRR" in s:
    print("3")
elif "SSS" in s:
    print("0")
elif "RRS" in s or "SRR" in s:
    print("2")
else:
    print("1")


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

#include <bits/stdc++.h>

int maiN() {
  std::string s;
  std::cin >> s;
  
  int r_cnt = 0;
  for (int i = 0; i < 3; ++i)
    if (s[i] == 'R') r_cnt++;
  
  if (r_cnt == 3) std::cout << r_cnt << std::endl;
  else if (r_cnt == 2 and s[1] == 'R') std::cout << r_cnt << std::endl;
  else if (r_cnt > 0) std::cout << 1 << std::endl;
  else std::cout << 0 << std::endl;
  
  return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

                         /*  (: ///////|||||| BEGINS |||||||\\\\ :) */
/* REMEMBER
Deletes all characters except first one     Deletes 4 characters from index number 1
    str.erase(1);                               str.erase(1,4);
Deletes character at position 4
 str.erase(str.begin() + 4);
bool compare(const pair<int, int>&a, const pair<int, int>&b)
{
   return a.second<b.second;
}
maxn = max_element(mp.begin(), mp.end(), compare)->second;
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
{
    return (a.second < b.second);
}
min(a,b,c,d)==min({a,b,c,d});
priority_queue <int, vector<int>, greater<int>> gquiz; // to create min heap
*/
#include<bits/stdc++.h>
using namespace std;
#define ll             long long int
#define endl           '\n'
#define mod            1000000007
#define fo(i,n)        for(int i=1;i<=n;i++)
#define tol(s)         transform(s.begin(),s.end(),s.begin(),::tolower)
#define tou(s)         transform(s.begin(),s.end(),s.begin(),::toupper)
#define all(x)         (x).begin(), (x).end()
#define pb             push_back
#define lb             lower_bound
#define ub             upper_bound
#define tr(it, a)      for(auto it = a.begin();it!=a.end();it++)
#define gcd(a,b)       __gcd(a,b)
#define pq             priority_queue
#define fr             first
#define sc             second
#define sz(x)          x.size()
#define T              ll t=0;cin>>t;for(ll test=0;test<t;test++)
 
const int inf=0x3f3f3f3f;
bool ispalindrome(string s) 
{ 
    ll len=s.length(); 
    for(ll i=0;i<len;i++){ 
        if(s[i]!=s[len-i-1]) 
        return false; 
    } 
    return true; 
} 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res*a;
        a = a*a;
        b >>= 1;
    }
    return res;
}
long long isprime(long long n)
{
    for(long long i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)return 0;
    }
    return 1;
}
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif


string s;
cin>>s;
if(s[0]=='R' && s[1]=='R' && s[2]=='R')cout<<3<<endl;
else if(s[1]=='R' && s[2]=='R' || s[0]=='R' && s[1]=='R')cout<<2<<endl;;
else if(s[2]=='R' || s[0]=='R' || s[1]=='R')cout<<1<<endl;
else
cout<<0<<endl;








return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:80:1: error: 'else' without a previous 'if'
   80 | else if(s[2]=='R' || s[0]=='R' || s[1]=='R')cout<<1<<endl;
      | ^~~~
Language: C++

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: expected ')' before 's'
    8 |     if(s[0]=='R' && s[1]=='R' s[2]=='R')
      |       ~                      ^~
      |                              )
a.cc:12:48: error: expected ')' before 's'
   12 |     else if(s[0]=='R' && s[1]=='R' || s[1]=='R' s[2]=='R')
      |            ~                                   ^~
      |                                                )
a.cc:16:35: error: expected ')' before 's'
   16 |     else if(s[0]=='S' && s[1]=='S' s[2]=='S')
      |            ~                      ^~
      |                                   )
Language: C++

#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

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


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

#include<stdio.h>

using namespace std;
int main()
{
	int flag=1;
	int n=0;
	char p[3];
	for(int i=0;i<3;i++)
	{
		scanf("%c",&p[i]);
	}
	for(int i=0;i<3;i++)
	{
		if(p[i]=='R')
		{
			++n;
		if((p[i+1]!='R')&&(flag==1))
		{
			printf("%d",n); 
			flag=0;
		}
	}
	}
	return 0;
 } 

Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
Language: Java

import java.awt.desktop.SystemEventListener;
import java.util.*;
import java.lang.*;
import java.io.*;


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

    }

}





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

#include<stdio.h>
#include<string>
int main(){
    char a[4];
    int cnt;
    int maxm=0;
    int i;
    scanf("%s",&a);
    cnt=0;
    for(i=0;i<4;i++){
        if(a[i]=='R'){
            cnt++;
        }
        else{
            if(cnt>=maxm){
                maxm=cnt;
            }
            cnt=0;
        }
    }
    printf("%d\n",maxm);
    return 0;
}


Compiler output:
main.c:2:9: fatal error: string: No such file or directory
    2 | #include<string>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>

using namespace std;

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

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

import java.util.Scanner;

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


		Scanner sc = new Scanner(System.in);
import java.util.Scanner;

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


		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		if (s.contains("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);
		}

	}


}
		String s = sc.next();

		if (s.contains("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.java:8: error: illegal start of expression
import java.util.Scanner;
^
Main.java:8: error: not a statement
import java.util.Scanner;
                ^
Main.java:10: error: illegal start of expression
public class Main {
^
Main.java:34: error: illegal start of type
		if (s.contains("RRR")){
		^
Main.java:34: error: <identifier> expected
		if (s.contains("RRR")){
		              ^
Main.java:34: error: illegal start of type
		if (s.contains("RRR")){
		               ^
Main.java:36: error: illegal start of type
		} else if (s.contains("RR")){
		  ^
Main.java:36: error: <identifier> expected
		} else if (s.contains("RR")){
		                     ^
Main.java:36: error: illegal start of type
		} else if (s.contains("RR")){
		                      ^
Main.java:38: error: illegal start of type
		} else if (s.contains("R")){
		  ^
Main.java:38: error: <identifier> expected
		} else if (s.contains("R")){
		                     ^
Main.java:38: error: illegal start of type
		} else if (s.contains("R")){
		                      ^
Main.java:40: error: illegal start of type
		} else {
		  ^
Main.java:47: error: class, interface, enum, or record expected
}
^
14 errors
Language: Java

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

using namespace std;
using ll = long long;

int main() {
	string n;
	int ans;
	cin >> n;
	if (n == "SSS") ans = 0;
	else if (n[1] == 'S') ans = 1;
	if (n == "RRR") ans = 3;
	if (n == "SRR" || n == "RRS") ans = 2;
	if (n == "SRS") ans = 1;

	cout << ans << endl;
	return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:2: error: illegal character: '#'
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
                                ^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
                                              ^
Main.java:3: error: illegal character: '#'
#define MOD 1000000007
^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
using ll = long long;
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: '.class' expected
using ll = long long;
                ^
Main.java:11: error: not a statement
	cin >> n;
	    ^
Main.java:18: error: not a statement
	cout << ans << endl;
	            ^
10 errors
Language: C++

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


int main(){
string S;
cin >> S;
if(S == RRR){
    cout << "3" << endl;
}

if(S.at(0) == S.at(1) || S.at(1) == S.at(2)){
    cout << "2" << endl;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'RRR' was not declared in this scope
    8 | if(S == RRR){
      |         ^~~
a.cc:16:9: error: 'SRS' was not declared in this scope
   16 | if(S == SRS || RSR){
      |         ^~~
a.cc:16:16: error: 'RSR' was not declared in this scope
   16 | if(S == SRS || RSR){
      |                ^~~
a.cc:19:9: error: 'SSS' was not declared in this scope
   19 | if(S == SSS){
      |         ^~~
Language: C++

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

	}
	if(s[1]=='R')
	{
		cnt2++;
		if(s[2]=='R')
			cnt2++;
	}
	if(s[2]=='R')
		cnt3++;
	cnt=max({cnt1,cnt2,cnt3});
	cout<<cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:31: error: unable to find numeric literal operator 'operator""cnt3'
    7 |         int cnt=0,cnt1=0,cnt2=0.cnt3=0;
      |                               ^~~~~~
a.cc:25:17: error: 'cnt3' was not declared in this scope; did you mean 'cnt2'?
   25 |                 cnt3++;
      |                 ^~~~
      |                 cnt2
a.cc:26:28: error: 'cnt3' was not declared in this scope; did you mean 'cnt2'?
   26 |         cnt=max({cnt1,cnt2,cnt3});
      |                            ^~~~
      |                            cnt2
a.cc:26:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   26 |         cnt=max({cnt1,cnt2,cnt3});
      |             ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: expected ')' before 's'
    8 |     if(s[0]=='R' && s[1]=='R' s[2]=='R')
      |       ~                      ^~
      |                              )
a.cc:12:48: error: expected ')' before 's'
   12 |     else if(s[0]=='R' && s[1]=='R' || s[1]=='R' s[2]=='R')
      |            ~                                   ^~
      |                                                )
a.cc:16:35: error: expected ')' before 's'
   16 |     else if(s[0]=='S' && s[1]=='s' s[2]=='S')
      |            ~                      ^~
      |                                   )
Language: Java

import java.util.*;
class Main
{
  public static void main(String args[])
  {
    Scanner sc=new Scanner(System.in);
	Scanner sc=new Scanner(System.in);
		String s=sc.next();
		if(s.contains("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.java:7: error: variable sc is already defined in method main(String[])
	Scanner sc=new Scanner(System.in);
	        ^
1 error
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:22:10: error: expected ';' before '}' token
   22 |     ans++
      |          ^
      |          ;
   23 |   }
      |   ~
Language: C++

#include "bits/stdc++.h"
//#include "ext/pb_ds/assoc_container.hpp" 
//#include "ext/pb_ds/tree_policy.hpp" 
using namespace std;
//using namespace __gnu_pbds;
#define ff first
#define ss second
#define ld long double
#define ll long long int
#define ull unsigned ll
#define ins insert
#define pb emplace_back
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define vvll vector<vll>
#define pii pair<int,int> 
#define pll pair<ll , ll>
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define fo(i,a,b) for(i=a; i<b; ++i)
#define foe(i,a,b) for(i=a; i<=b; ++i)
#define rep(i,n) for(i=0;i<n;i++)
#define rep1(i,n) for(i=1;i<=n;i++)
#define per(i,n) for(i=n-1;i>=0;i--)
#define per1(i,n) for(i=n;i>=1;i--)
#define mod 1000000007
#define pi 3.141592653589793238460
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0)
//#define pbds tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif


int main(){
    fast;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ll t, i, j;
    t=1;
    while(t--){
        ll n, k;
        string s;
         cin>>s;
         s+="P";
         vi v;
         for(i=0; i<3; i++){
         	ll cnt=0;
         	if(s[i] == 'R'){
         		cnt++;
         		while(s[i+1] == 'R' && i<3)){
         			i++;cnt++;
         		}
         		v.pb(cnt);
         	}
         }
         cout<<*max_element(all(v))<<'\n';

    }
    return 0;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:67:52: error: expected primary-expression before ')' token
   67 |                         while(s[i+1] == 'R' && i<3)){
      |                                                    ^
Language: C

//https://atozmath.com/CONM/GaussEli.aspx?q=GJ2&q1=2%6020x%2b2y%2b6z%3d28%2cx%2b20y%2b9z%3d-23%2c2x-7y-20z%3d-57%60GJ2%600%2c0%2c0%601.25&dm=D&dp=6&do=1#PrevPart


//https://planetcalc.com/3712/


//https://keisan.casio.com/calculator

//https://www.easycalculation.com/algebra/newton-raphson-calculator.php
//https://planetcalc.com/7748/

//https://www.codesansar.com/numerical-methods/bisection-method-online-calculator.htm
//https://planetcalc.com/3718/

#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef pair<ll,ll> pll;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL))
#define fi first
#define se second
#define pb push_back
ll const MOD=1000000007;
const int M= 2e5 + 10;
#define eb emplace_back
vector<ll>v[M+10];
ll n,m;
bool vis[M+10];
ll cost[M+1];
void BFS(ll s)
{
    vis[s]=true;
    cost[s]=0;
    queue<ll>q;
    q.push(s);
    while(!q.empty())
    {
        ll u=q.front();
        q.pop();
       for(auto x:v[u])
       {
           if(!vis[x])
           {
               cost[x]=cost[u]+1;
               vis[x]=true;
               q.push(x);
           }
       }
    }
}
void input()
{
     cin>>n>>m;
    ll a,b;
    for(ll i=0;i<m;i++)
    {
        cin>>a>>b;
       v[a].pb(b);
       v[b].pb(a);
    }
}
int main()
{
    fastread();
    input();
    ll s;
   cin>>s;
    BFS(s);
    for(ll i=0;i<=n;i++)
    {
        cout<<i<<" "<<cost[i]<<endl;
    }
}
/*
6 6
1 2
1 3
2 4
2 6
3 5
3 4
*/
/*#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef pair<ll,ll> pll;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL))
#define fi first
#define se second
#define pb push_back
ll const MOD=1000000007;
const int M= 2e5 + 10;
///-------------------------------------------------------------------------------------------------///
///                KARMA IS LIKE 69,,, YOU GET WHAT YOU GIVE                                        ///
///-------------------------------------------------------------------------------------------------///
#define eb emplace_back
vector<pll>v[M+10];
ll n,m;
bool vis[M+10];
ll cost[M+1];
void BFS(ll s)
{
    vis[s]=true;
    cost[s]=0;
    queue<ll>q;
    q.push(s);
    while(!q.empty())
    {
        ll u=q.front();
        q.pop();
       for(auto x:v[u])
       {
           ll node=x.fi;
           ll w=x.se;
           if(!vis[node])
           {
               cout<<node<<" "<<u<<endl;
               cost[node]=cost[u]+w;
               vis[node]=true;
               q.push(node);
           }
       }
    }
}
void input()
{
     cin>>n>>m;
    ll a,b,c;
    for(ll i=0;i<m;i++)
    {
        cin>>a>>b>>c;
       v[a].eb(b,c);
       v[b].eb(a,c);
    }
}
int main()
{
    fastread();
    input();
    ll s;
   cin>>s;
    BFS(s);
 cout<<endl<<endl;
    for(ll i=1;i<=n;i++)
    {
     //   cout<<i<<" "<<cost[i]<<endl;
    }
}
/*
6 6
1 2 5
1 3 4
2 4 5
2 6 5
3 5 4
3 4 4
3
*/


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

import java.util.*;
import java.io.*;
public class A{
	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 in  = new FastReader();
		String s = in.next();
		int max = 0;
		for(int i = 0; i < s.length(); i++){
			if(s.charAt(i) == 'R'){
				int count = 0;
				for(int j = i; j < s.length() && s.charAt(j) == 'R'; j++){
					count++;
					i = j;
				}
				max = Math.max(max,count);
			}
		}
		System.out.println(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>
#include<string.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 10;
int main()
{
    char s[100];
    gets(s);
    int tmp = 0;
    int i = 0;
    int max1 = 0;
    while(s[i] != '\0') {
        if(s[i] == 'R') {
            tmp++;
            max1 = max(max1, tmp);
        }
        if(s[i] == 'S')
            tmp = 0;
        i++;
    }
    printf("%d\n",max1);
    //system("pause");
    return 0;
}

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

#include<bits/stdc++.h>
#define int long long
#define PI 3.14159265
int mod = 1000000009;
#define fi(i,start,end) for(int i=0; i<n; i++)
#define pb(x) push_back(x)
#define int long long
#define PI 3.14159265
#define all(v) v.begin(), v.end()
#define endl cout<<"\n" 
#define ll long long
#define dbg(x) cout<<#x<<" "<<x;endl;
#define bye endl;return
using namespace std;
template<typename T>



void debug(vector<T> x){
    for(auto e:x){
        cout<<e<<" ";
    }
    cout<<"\n";
}
/*
1
8 6
1 2 4 1 2 4 1 2

*/


void solve(){
    int n;
    string s;
    cin>>s;
    n = s.size();
    bool start = false;
    int cur = 0;
    vector<int> helper;
    for(int i=0; i<n; i++){
        if(s[i]=='S'){
            if(!start){
                start = true;
            }
            cur++;
        }else{
            if(start){
                helper.push_back(cur);
                cur = 0;
                start = false;
            }
        }
    }
    if(cur > 0)
        helper.push_back(cur);
    if(helper.size()>0)
    int ans = *max_element(all(helper));
    else
    {
        cout<<0;bye;
    }
    
    cout<<ans;bye;
    
}

signed main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int t = 1;;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:64:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   64 |     cout<<ans;bye;
      |           ^~~
      |           abs
Language: Java

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

public class a {
    public static void main(final String[] args) {
        final FastReader s=new FastReader();
        String st = s.nextLine();
        int count=0;
        int local = 0;
        for (char c : st.toCharArray()) {
            if(c=='R'){
                    local++;
            } else {
                count = Math.max(count, local);
                local=0;
            }
        }
        count = Math.max(count, local);
        System.out.println(count);
    }

    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 (final 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 (final IOException e) { e.printStackTrace(); }
            return str;
        }
    }
}

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

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

int main(){
cin >> S;
if(S == RRR){
    cout << "3" << endl;
}

if(S.at(0) == S.at(1) || S.at(1) == S.at(2)){
    cout << "2" << endl;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'RRR' was not declared in this scope
    7 | if(S == RRR){
      |         ^~~
a.cc:15:9: error: 'SRS' was not declared in this scope
   15 | if(S == SRS || RSR){
      |         ^~~
a.cc:15:16: error: 'RSR' was not declared in this scope
   15 | if(S == SRS || RSR){
      |                ^~~
a.cc:18:9: error: 'SSS' was not declared in this scope
   18 | if(S == SSS){
      |         ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before 'else'
    9 |     if(S=="RRR")ans=3
      |                      ^
      |                      ;
   10 |     else if(S=="RRS" || S=="SRR")ans =2;
      |     ~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SSR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   else if(s="SSR") cout<<1;
      |           ~^~~~~~
      |            |
      |            std::__cxx11::basic_string<char>
a.cc:10:12: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SRS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   10 |   else if(s="SRS") cout<<1;
      |           ~^~~~~~
      |            |
      |            std::__cxx11::basic_string<char>
a.cc:11:12: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RSS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |   else if(s="RSS") cout<<1;
      |           ~^~~~~~
      |            |
      |            std::__cxx11::basic_string<char>
a.cc:12:12: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SRR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   12 |   else if(s="SRR") cout<<2;
      |           ~^~~~~~
      |            |
      |            std::__cxx11::basic_string<char>
a.cc:13:12: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RSR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   13 |   else if(s="RSR") cout<<1;
      |           ~^~~~~~
      |            |
      |            std::__cxx11::basic_string<char>
a.cc:14:12: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RRS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   14 |   else if(s="RRS") cout<<2;
      |           ~^~~~~~
      |            |
      |            std::__cxx11::basic_string<char>
a.cc:15:12: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"RRR"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   15 |   else if(s="RRR") cout<<3;
      |           ~^~~~~~
      |            |
      |            std::__cxx11::basic_string<char>
Language: C++

                         /*  (: ///////|||||| BEGINS |||||||\\\\ :) */
/* REMEMBER
Deletes all characters except first one     Deletes 4 characters from index number 1
    str.erase(1);                               str.erase(1,4);
Deletes character at position 4
 str.erase(str.begin() + 4);
bool compare(const pair<int, int>&a, const pair<int, int>&b)
{
   return a.second<b.second;
}
maxn = max_element(mp.begin(), mp.end(), compare)->second;
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
{
    return (a.second < b.second);
}
min(a,b,c,d)==min({a,b,c,d});
priority_queue <int, vector<int>, greater<int>> gquiz; // to create min heap
*/
#include<bits/stdc++.h>
using namespace std;
#define ll             long long int
#define endl           '\n'
#define mod            1000000007
#define fo(i,n)        for(int i=1;i<=n;i++)
#define tol(s)         transform(s.begin(),s.end(),s.begin(),::tolower)
#define tou(s)         transform(s.begin(),s.end(),s.begin(),::toupper)
#define all(x)         (x).begin(), (x).end()
#define pb             push_back
#define lb             lower_bound
#define ub             upper_bound
#define tr(it, a)      for(auto it = a.begin();it!=a.end();it++)
#define gcd(a,b)       __gcd(a,b)
#define pq             priority_queue
#define fr             first
#define sc             second
#define sz(x)          x.size()
#define T              ll t=0;cin>>t;for(ll test=0;test<t;test++)
 
const int inf=0x3f3f3f3f;
bool ispalindrome(string s) 
{ 
    ll len=s.length(); 
    for(ll i=0;i<len;i++){ 
        if(s[i]!=s[len-i-1]) 
        return false; 
    } 
    return true; 
} 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res*a;
        a = a*a;
        b >>= 1;
    }
    return res;
}
long long isprime(long long n)
{
    for(long long i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)return 0;
    }
    return 1;
}
int main()
{
ios_base::sync_with_stdio(false);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 cn=0;
if(s[0]=='R' && s[1]=='R' && s[2]=='R')cout<<3<<endl;
else if(s[1]=='R' && s[2]=='R' || s[0]=='R' && s[1]=='R')cout<<2<<endl;;
else if(s[2]=='R' || s[0]=='R' || s[1]=='R')cout<<1<<endl;
else
cout<<0<<endl;








return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:81:1: error: 'else' without a previous 'if'
   81 | else if(s[2]=='R' || s[0]=='R' || s[1]=='R')cout<<1<<endl;
      | ^~~~
Language: C++

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before '{' token
   12 |     }else(s=="RRR") {
      |                    ^~
      |                    ;
a.cc:12:12: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   12 |     }else(s=="RRR") {
      |          ~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<iterator>
#include<math.h>
#include<cstring>
using namespace std;
void lets_play()

{
    int i,c=0;
    char s[100];

    gets(s);
     for(i=0;i<strlen(s);i++)
   {
       if(s[i]=='R')
        c++;
   }
   printf("%d\n",c);

    }




int main()
{
   lets_play();
}


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

#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define INF 2147483647
using namespace std;
using Graph=vector<vector<int>>;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: expected ';' before '}' token
   25 |       ma=max(ans,ma)
      |                     ^
      |                     ;
   26 |     }else{
      |     ~
Language: C++

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

#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define rep(i, x, y) for(decltype(y) i = (x) - ((x) > (y)); i != (y) - ((x) > (y)); i += 1 - 2 * ((x) > (y)))
#define trav(i,a) for(auto& (i) : (a))
#define all(a) (a).begin(),(a).end()
#define sz(a) int((a).size())
#define clr(a,x) memset((a),(x),sizeof(a)) // array (0,-1)
#define dbg(x) cerr << "STDERR => " << __LINE__ << ": " << #x << " = " << (x) << "  :(\n";
#define pb push_back
#define mp make_pair
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline void cpuTime() { cerr << "cpu time : " << double(clock())/CLOCKS_PER_SEC << "\n"; return; }
using ll = long long;
using ull = unsigned long long;
using F = float;
using D = double;
using vi = vector<int>;
using pii = pair<int,int>;



void solve(){

    string s;
    cin >> s;

    int cnt = 0;
    rep(i,0,2){
        if(s[i] == 'R'){
            if(!cnt) cnt = 1;
            if(s[i+1] == 'R'){
                ++cnt;
            }
        }
    }

    cout << cnt << "\n";SSS


    return;
}

/*
 read the question carefully ( what're the exact constraints? )
 look out for SPECIAL CASES (n=1?) and OVERFLOW (ll vs int?) ARRAY OUT OF BOUNDS
 Check datatypes
*/
int main(){

    fast_io;
    int t=1;
    // cin >> t;

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

    cpuTime();
return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:39:25: error: 'SSS' was not declared in this scope
   39 |     cout << cnt << "\n";SSS
      |                         ^~~