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

#include<bits/stdc++.h>
#define ll long long int
#define forn(n1,n2) for(ll i=n1;i<n2;i++)
#define w(t) ll t;cin>>t;while(t--)
#define en "\n"
using namespace std;
 
 
int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int dp[4];
    memset(dp,0,sizeof(dp));
    string s;
    cin>>s;
  for(i=1;i<=3;i++)
  {s[i-1]=='R'?dp[i]=1:dp[i]=0;}
      for(int i=1;i<=3;i++)
    {
        if(s[i-1]=='R')
        dp[i]=max(dp[i],dp[i-1]+1);
        else
        {
            dp[i]=dp[i-1];
        }
    }
    cout<<dp[3];
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'i' was not declared in this scope
   18 |   for(i=1;i<=3;i++)
      |       ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  int ans == 0;
  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 = 2;
  if (s == "SSS") ans = 0;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected initializer before '==' token
    7 |   int ans == 0;
      |           ^~
a.cc:8:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   if (s == "RRR") ans = 3;
      |                   ^~~
      |                   abs
a.cc:9:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   if (s == "RRS") ans = 2;
      |                   ^~~
      |                   abs
a.cc:10:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   if (s == "RSR") ans = 1;
      |                   ^~~
      |                   abs
a.cc:11:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   if (s == "RSS") ans = 1;
      |                   ^~~
      |                   abs
a.cc:12:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   if (s == "SRR") ans = 2;
      |                   ^~~
      |                   abs
a.cc:13:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   if (s == "SRS") ans = 1;
      |                   ^~~
      |                   abs
a.cc:14:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   if (s == "SSR") ans = 2;
      |                   ^~~
      |                   abs
a.cc:15:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |   if (s == "SSS") ans = 0;
      |                   ^~~
      |                   abs
a.cc:16:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int c=0,v=0;
    cin>>s;
    int l = s.size();
    for(int i=0;i<l;i++)
    {
       // cout<<s[i];
        if(s[i]=='R')
            c++;
        else
        {
            v=max(v,c);
            c=0;
        }
    }
    cout<<V<<endl;
    //cout<<l<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'V' was not declared in this scope
   21 |     cout<<V<<endl;
      |           ^
Language: C++

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


int main(){
	string s;
	cin>>s;
int ind =-1,ans=1;
for(int i=0;i<3;i++) {
	if(s[i]=='R'){
		if(ind==-1) ind=i;
		else if(ind==(i-1)) ans++, ind=i;
	}
}
	cout<<(ind==-1?0:ansRSR);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: 'ansRSR' was not declared in this scope
   15 |         cout<<(ind==-1?0:ansRSR);
      |                          ^~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:9:30: error: lvalue required as left operand of assignment
    9 |   if(S[0]="R"&&S[1]="R"&&S[2]="R")
      |                              ^
main.c:11:45: error: lvalue required as left operand of assignment
   11 |   else if(S[0]="R"&&S[1]="R"||S[1]="R"&&S[2]="R")
      |                                             ^
main.c:13:35: error: lvalue required as left operand of assignment
   13 |   else if(S[0]="R"||S[1]="R"||S[2]="R")
      |                                   ^
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(){
    char i;
    char S[3];
    int rain;
    for(i= 0;i<4;i++){
        scanf("%d",S[i]);
        if(S[i]==R){
            rain++;
        }else if(rain>0){
            rain--;
        }
    }
    return rain;
}


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

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    
    //入力する変数
    String S = "";
    
    //R(雨の日)が連続した日数
    int count = 0;
    
    // 要件を満たさない場合繰り返す
    while(S.length() != 3){
    	S = scanner.next();
    }
        
    //入力した変数を一文字ずつ分割して格納する
    String[] strArray = new String[S.length()];
    
    //文字列を分割してstrArrayにそれぞれ格納する
    for(int i=0; i<S.length(); i++){
		String str = String.valueOf(S.charAt(i));
      	strArray[i] = str;
    }
    
    //ここから雨の連続日数を数える
    //1日雨だとcountに1を代入する
    for(int j=0; j<S.length(); j++){
      	if(strArray[j] == 'R'){
          	count = 1;
        }
    }
    //2日雨だとcountに2代入する
    if(strArray[0] == 'R'){
        if(strArray[0] == strArray[1] || strArray[1] == strArray[2]){
            count = 2;
        }
    }
    //3日雨だとcountに3代入する
    int tmp = 0;
    for(int k=0; k<S.length(); k++){
     	if(strArray[k] == 'R'){
         	tmp++;
        }
    }
    if(tmp == 3){
     	count = 3; 
    }
    
    //何連続雨だったか出力する
    System.out.println(count);
    
    
  }
}

Compiler output:
Main.java:30: error: bad operand types for binary operator '=='
      	if(strArray[j] == 'R'){
      	               ^
  first type:  String
  second type: char
Main.java:35: error: bad operand types for binary operator '=='
    if(strArray[0] == 'R'){
                   ^
  first type:  String
  second type: char
Main.java:43: error: bad operand types for binary operator '=='
     	if(strArray[k] == 'R'){
     	               ^
  first type:  String
  second type: char
3 errors
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    
    //入力する変数
    String S;
    
    //R(雨の日)が連続した日数
    int count = 0;
    
    // 要件を満たさない場合繰り返す
    while(S.length() != 3){
    	S = scanner.next();
    }
        
    //入力した変数を一文字ずつ分割して格納する
    String[] strArray = new String[S.length()];
    
    //文字列を分割してstrArrayにそれぞれ格納する
    for(int i=0; i<S.length(); i++){
		String str = String.valueOf(S.charAt(i));
      	strArray[i] = str;
    }
    
    //ここから雨の連続日数を数える
    //1日雨だとcountに1を代入する
    for(int j=0; j<S.length(); j++){
      	if(strArray[j] == "R"){
          	count = 1;
        }
    }
    //2日雨だとcountに2代入する
    if(strArray[0] == "R"){
        if(strArray[0] == strArray[1] || strArray[1] == strArray[2]){
            count = 2;
        }
    }
    //3日雨だとcountに3代入する
    int tmp = 0;
    for(int k=0; k<S.length(); k++){
     	if(strArray[k] == "R"){
         	tmp++;
        }
    }
    if(tmp == 3){
     	count = 3; 
    }
    
    //何連続雨だったか出力する
    System.out.println(count);
    
    
  }
}

Compiler output:
Main.java:14: error: variable S might not have been initialized
    while(S.length() != 3){
          ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    
    //入力する変数
    String S;
    
    //入力した変数を一文字ずつ分割して格納する
    String[] strArray = new String[S.length()];
    
    //R(雨の日)が連続した日数
    int count = 0;
    
    // 要件を満たさない場合繰り返す
    while(S.length() != 3){
    	S = scanner.next();
    }
    
    //文字列を分割してstrArrayにそれぞれ格納する
    for(int i=0; i<S.length(); i++){
		String str = String.valueOf(S.charAt(i));
      	strArray[i] = str;
    }
    
    //ここから雨の連続日数を数える
    //1日雨だとcountに1を代入する
    for(int j=0; j<S.length(); j++){
      	if(strArray[j] == "R"){
          	count = 1;
        }
    }
    //2日雨だとcountに2代入する
    if(strArray[0] == "R"){
        if(strArray[0] == strArray[1] || strArray[1] == strArray[2]){
            count = 2;
        }
    }
    //3日雨だとcountに3代入する
    int tmp = 0;
    for(int k=0; k<S.length(); k++){
     	if(strArray[k] == "R"){
         	tmp++;
        }
    }
    if(tmp == 3){
     	count = 3; 
    }
    
    //何連続雨だったか出力する
    System.out.println(count);
    
    
  }
}

Compiler output:
Main.java:11: error: variable S might not have been initialized
    String[] strArray = new String[S.length()];
                                   ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    
    //入力する変数
    String S;
    
    //入力した変数を一文字ずつ分割して格納する
    String[] strArray = new String[S.length()];
    
    //R(雨の日)が連続した日数
    int count = 0;
    
    // 要件を満たさない場合繰り返す
    while(S.length() != 3){
    	S = scanner.next();
    }
    
    //文字列を分割してstrArrayにそれぞれ格納する
    for(int i=0; i<S.length(); i++){
		String str = String.valueOf(S.charAt(i));
      	strArray[i] = str;
    }
    
    //ここから雨の連続日数を数える
    //1日雨だとcountに1を代入する
    for(int j=0; j<S.length(); j++){
      	if(strArray[j] == R){
          	count = 1;
        }
    }
    //2日雨だとcountに2代入する
    if(strArray[0] == strArray[1] || strArray[1] == strArray[2]){
      	count = 2;
    }
    //3日雨だとcountに3代入する
    int tmp = 0;
    for(int k=0; k<S.length(); k++){
     	if(strArray[k] == R){
         	tmp++;
        }
    }
    if(tmp == 3){
     	count = 3; 
    }
    
    //何連続雨だったか出力する
    System.out.println(count);
    
    
  }
}

Compiler output:
Main.java:30: error: cannot find symbol
      	if(strArray[j] == R){
      	                  ^
  symbol:   variable R
  location: class Main
Main.java:41: error: cannot find symbol
     	if(strArray[k] == R){
     	                  ^
  symbol:   variable R
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath> 
#include <iomanip> 
using namespace std;
typedef long long ll;
ll a=0,b=0,c=0,d=0,e=0,f=0,g=0,i=0,j=0,k=0;

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


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

import java.util.*;
import java.lang.*;
public class Main
{
  public static void main(String args[])
  {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    if(s.charAt(0)=='R' && s.charAt(1)=='R' && s.charAt(2)=='R')
      System.out.println(3);
    else if(s.charAt(1)=='R' && (s.charAt(0)=='R' || s.charAt(2)=='R'))
      System.out.println(2);
    else if(s.charAt(0)=='R' || s.charAt(1)=='R' || s.charAt(2)=='R')
      System.out.println(1);
    else
        System.out.println(0);
    
}


Compiler output:
Main.java:18: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;
import java.lang.*;
public class A
{
  public static void main(String args[])
  {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int r=0,count_r = 0;
    for(int i=0;i<3;i++)
    {
      if(s.charAt(i)=='R')
        r++;
      if(i<3 && s.charAt(i)=='R' && s.charAt(i+1)=='R')
        count_r++;
    }
    if(count_r==0)
      System.out.println(r);
    else
      System.out.println(count_r);
  }
}

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++

int main() {
    string s;
    cin>>s;
    int ans = 0;
    int count = 0;
    for(char c:s){
        if(c == 'S'){
             count = 0;
        }else{
            ++count;
        }
        ans = max(ans, count);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'string' was not declared in this scope
    2 |     string s;
      |     ^~~~~~
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>s;
      |     ^~~
a.cc:3:10: error: 's' was not declared in this scope
    3 |     cin>>s;
      |          ^
a.cc:12:15: error: 'max' was not declared in this scope
   12 |         ans = max(ans, count);
      |               ^~~
a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   14 |     cout << ans << endl;
      |     ^~~~
      |     count
a.cc:14:20: error: 'endl' was not declared in this scope
   14 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include<bts/stdc++.h>
using namespace std;
int main()
{
  string str;
  cin>>str;
  vector<int> v;
  int res=0;
  for(int i=0;i<3;i++)
  {
    if(str[i]=='R')
      res++;
    else
    {
      v.push_back(res);
      res=0;
    }
  }
  cout<<*max_element(v.begin(),v.end());
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string str;
  cin>>str;
  int res=0;
  for(int i=0;i<s.length()-1;i++)
  {
     if(s[i]=='R' && s[i+1]=='R')
       res = res+2;
    if(s[i]=='R' && s[i+1]!='R')
      res++;
  }
  cout<<res;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 's' was not declared in this scope
    8 |   for(int i=0;i<s.length()-1;i++)
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   string s;
   cin>>str;
   int res=1;
  for(int i=0;i<str.length()-1;i++)
  {
    if(str[i]==str[i+1])
       res++;
  }
  
 cout<<res; 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |    cin>>str;
      |         ^~~
      |         std
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;

int main(){
  ll X, K, D;
  cin >> X >> K >> D;
  
  X = abs(X);
  
  ll x = X;
  bool ABS = false;
  ll count = 0;
  for(ll i = 0; i < K; i++){
    x -= D;
    if (x * X <= 0){
      abs = true;
      count = i+1;
      break;
    }
  }
  
  if (ABS){
    if ((K-count)%2) cout << x+D << endl;
    else cout << -x << endl;
  }
  else cout << x << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: overloaded function with no contextual type information
   18 |       abs = true;
      |             ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before '}' token
    8 |   if(a=="RRR"){ansewr=3}
      |                        ^
      |                        ;
a.cc:9:24: error: expected ';' before '}' token
    9 |   if(a=="RRS"){ansewr=2}
      |                        ^
      |                        ;
a.cc:10:24: error: expected ';' before '}' token
   10 |   if(a=="RSR"){ansewr=1}
      |                        ^
      |                        ;
a.cc:11:24: error: expected ';' before '}' token
   11 |   if(a=="SRR"){ansewr=2}
      |                        ^
      |                        ;
a.cc:12:24: error: expected ';' before '}' token
   12 |   if(a=="RSS"){ansewr=1}
      |                        ^
      |                        ;
a.cc:13:24: error: expected ';' before '}' token
   13 |   if(a=="SSR"){ansewr=1}
      |                        ^
      |                        ;
a.cc:14:24: error: expected ';' before '}' token
   14 |   if(a=="SRS"){ansewr=1}
      |                        ^
      |                        ;
a.cc:15:24: error: expected ';' before '}' token
   15 |   if(a=="SSS"){ansewr=0}
      |                        ^
      |                        ;
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
    8 |   if(a=="RRR"){answer=3}
      |                ^~~~~~
      |                ansewr
a.cc:9:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
    9 |   if(a=="RRS"){answer=2}
      |                ^~~~~~
      |                ansewr
a.cc:10:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   10 |   if(a=="RSR"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:11:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   11 |   if(a=="SRR"){answer=2}
      |                ^~~~~~
      |                ansewr
a.cc:12:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   12 |   if(a=="RSS"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:13:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   13 |   if(a=="SSR"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:14:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   14 |   if(a=="SRS"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:15:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   15 |   if(a=="SSS"){answer=0}
      |                ^~~~~~
      |                ansewr
a.cc:16:11: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   16 |   cout << answer;
      |           ^~~~~~
      |           ansewr
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
    8 |   if(S=="RRR"){answer=3}
      |                ^~~~~~
      |                ansewr
a.cc:9:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
    9 |   if(S=="RRS"){answer=2}
      |                ^~~~~~
      |                ansewr
a.cc:10:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   10 |   if(S=="RSR"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:11:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   11 |   if(S=="SRR"){answer=2}
      |                ^~~~~~
      |                ansewr
a.cc:12:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   12 |   if(S=="RSS"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:13:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   13 |   if(S=="SSR"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:14:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   14 |   if(S=="SRS"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:15:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   15 |   if(S=="SSS"){answer=0}
      |                ^~~~~~
      |                ansewr
a.cc:16:11: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   16 |   cout << answer;
      |           ^~~~~~
      |           ansewr
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: 'a' was not declared in this scope
    8 |   if(a=="RRR"){answer=3}
      |      ^
a.cc:8:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
    8 |   if(a=="RRR"){answer=3}
      |                ^~~~~~
      |                ansewr
a.cc:9:6: error: 'a' was not declared in this scope
    9 |   if(a=="RRS"){answer=2}
      |      ^
a.cc:9:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
    9 |   if(a=="RRS"){answer=2}
      |                ^~~~~~
      |                ansewr
a.cc:10:6: error: 'a' was not declared in this scope
   10 |   if(a=="RSR"){answer=1}
      |      ^
a.cc:10:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   10 |   if(a=="RSR"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:11:6: error: 'a' was not declared in this scope
   11 |   if(a=="SRR"){answer=2}
      |      ^
a.cc:11:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   11 |   if(a=="SRR"){answer=2}
      |                ^~~~~~
      |                ansewr
a.cc:12:6: error: 'a' was not declared in this scope
   12 |   if(a=="RSS"){answer=1}
      |      ^
a.cc:12:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   12 |   if(a=="RSS"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:13:6: error: 'a' was not declared in this scope
   13 |   if(a=="SSR"){answer=1}
      |      ^
a.cc:13:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   13 |   if(a=="SSR"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:14:6: error: 'a' was not declared in this scope
   14 |   if(a=="SRS"){answer=1}
      |      ^
a.cc:14:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   14 |   if(a=="SRS"){answer=1}
      |                ^~~~~~
      |                ansewr
a.cc:15:6: error: 'a' was not declared in this scope
   15 |   if(a=="SSS"){answer=0}
      |      ^
a.cc:15:16: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   15 |   if(a=="SSS"){answer=0}
      |                ^~~~~~
      |                ansewr
a.cc:16:11: error: 'answer' was not declared in this scope; did you mean 'ansewr'?
   16 |   cout << answer;
      |           ^~~~~~
      |           ansewr
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
using namespace std;
void solve();
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int t = 1;
	
	for (int i = 1; i <= t; i++)
	{	//cout<<"Case #"<<i<<": ";
		solve();
		cout << "\n";
	}

	cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
	return 0;
}
void solve()
{	int s;
	cin>>s;
	int r=0;
	for(int i=0;i<3;i++){
		if(s[i]=='R')
		{
			r++;
		}
	}
	cout<<r;
}
	

Compiler output:
a.cc: In function 'void solve()':
a.cc:31:21: error: invalid types 'int[int]' for array subscript
   31 |                 if(s[i]=='R')
      |                     ^
Language: C++

// Created by js0805
#include <bits/stdc++.h>
#include<algorithm>
#include<vector>
#include<string>
#define ll long long
#define fr(a,b) for(ll i=a;i<b;i++)
#define prDouble(x) cout << fixed << setprecision(10) <<x
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<string, int> msi;
void solve() {
    string s;
    cin >> s;
    int r = 0;
    for (int i = 0; i < .length(); i++) {
        if (s[i] == 'R') {
            r++;
        }
    }
    cout << r ;
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    solve();

    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:19:25: error: expected primary-expression before '.' token
   19 |     for (int i = 0; i < .length(); i++) {
      |                         ^
Language: C++

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

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 <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <bits/stdc++.h>
#include <set>
#include <vector>
#include <queue>
#include <bitset>
#define NL << endl
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define endl "\n"
#define fill(x, y) memset(x, y, sizeof(y))
#define debug(x)                          \
    {                                     \
        cerr << #x << " = " << x << endl; \
    }
#define inarr(arr, n)                            \
    {                                       \
        for(int i =0;i<n;i++){              \
            cin >> arr[i];                  \
        }                                   \
    }
#define out(a) cout << a << endl;
typedef long long ll;
const int MOD = 1e9 + 7;
using namespace std;

void solve()
{
    string s; cin >> s;
    if(s=="RRR"){
        out(3);
    }
    else if(s=="RRS" || s == "SRR"){
        out(2);
    }
    else if(s=="SSS"){
        out(0);
    }
    else{
        out(1);
    }
    return 0;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:47:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   47 |     return 0;
      |            ^
Language: C++

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

int main (){
    char S[3];

    for (int i =0; i<3; i++){
        //check if input is S or R
		do {
         cin.clear();
           cin >> S[i];

        } while (S[i] != 'R' && S[i] != 'S');
	}
	
	if ( S [0] || S[1] || S[2] == 'R' ) {
		
		cout << 1;
	} 
	
	else if (S[0] ==S[1] == 'R'){
		cout << 2;
	}
	
	else if (S[1] ==S[2] == 'R'){
		cout << 2;
	}
	
	
	else if (S[0] == S[1] == S[2]== 'R')
	{
		cout << 3;
	}
	
	else {
		cout << 0;

}

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

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
    4 | string s;
      | ^~~~~~
a.cc:4:1: 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:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | 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:5:6: error: 's' was not declared in this scope
    5 | cin>>s;
      |      ^
a.cc:11:36: error: 'max' was not declared in this scope; did you mean 'std::max'?
   11 | else if(s[i]=='S' and flag==1){ans=max(ans,cnt);flag=0;}
      |                                    ^~~
      |                                    std::max
In file included from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:13:5: error: 'max' was not declared in this scope; did you mean 'std::max'?
   13 | ans=max(ans,cnt);
      |     ^~~
      |     std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:14:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 | cout<<ans<<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:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 | cout<<ans<<endl;
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

Compiler output:
a.cc:7:10: warning: missing terminating ' character
    7 | if(s[0]=='R)cnt+=1,flag=1;
      |          ^
a.cc:7:10: error: missing terminating ' character
    7 | if(s[0]=='R)cnt+=1,flag=1;
      |          ^~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
    4 | string s;
      | ^~~~~~
a.cc:4:1: 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:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | 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:5:6: error: 's' was not declared in this scope
    5 | cin>>s;
      |      ^
a.cc:8:1: error: expected primary-expression before 'for'
    8 | for(int i=1;i<s.size();i++){
      | ^~~
a.cc:7:10: error: expected ')' before 'for'
    7 | if(s[0]=='R)cnt+=1,flag=1;
      |   ~      ^
      |          )
    8 | for(int i=1;i<s.size();i++){
      | ~~~       
a.cc:8:13: error: 'i' was not declared in this scope
    8 | for(int i=1;i<s.size();i++){
      |             ^
a.cc:13:5: error: 'max' was not declared in this scope; did you mean 'std::max'?
   13 | ans=max(ans,cnt);
      |     ^~~
      |     std::max
In file included from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:14:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 | cout<<ans<<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:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 | cout<<ans<<endl;
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <string>

int main()
{
  std::string str;
  std::cin >> str;
  int cnt = 0;
  int max_cnt = 0;
  for (int i=0; i<str.length(); i++) {
    if (c=='S') cnt = 0;
    else {
      cnt++;
      max_cnt = std::max(max_cnt, cnt);
    }
  }
  std::cout << max_cnt << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'c' was not declared in this scope
   11 |     if (c=='S') cnt = 0;
      |         ^
Language: C++

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

int main(){
	str 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: In function 'int main()':
a.cc:5:9: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |         str s;
      |         ^~~
      |         std
a.cc:6:14: error: 's' was not declared in this scope
    6 |         cin>>s;
      |              ^
a.cc:7:18: error: 'R' was not declared in this scope
    7 |         if(s[0]==R){
      |                  ^
a.cc:8:12: error: 'S' was not declared in this scope
    8 |         if(S[1]==R){
      |            ^
a.cc:21:12: error: 'S' was not declared in this scope
   21 |         if(S[1]==R){
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define mod 1000000007
#define pub(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define getl(s) getline(cin,s);

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin>>s;
  int ans =0;
  for(int i=0;i<s.length();){
    if(s[i]!='R'){
      i++;
    }else{
      int f =0;
      while(s[i]=='R'){
        f++;
        i++;
      }
      ans = max(f,ans);
    }
  }
  cout<<ans;
  return 0;
}


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

#include <bits/stdc++.h>
#include <windows.h>
#include <conio.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define mod 1000000007
#define pub(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define getl(s) getline(cin,s);
void SystemCall(string call){
    system(&call[0]);
}

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin>>s;
  int ans =0;
  for(int i=0;i<s.length();){
    if(s[i]!='R'){
      i++;
    }else{
      int f =0;
      while(s[i]=='R'){
        f++;
        i++;
      }
      ans = max(f,ans);
    }
  }
  cout<<ans;
  return 0;
}


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

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int r,c,k;
cin>>r>>c>>k;
int arr[r][c]={0};
for(int i=0;i<k;i++){
int p,q,t;
cin>>p>>q>>t;
arr[p-1][q-1]=t;
}
int dp[r+1][c+1][4]={0};
for(int i=1;i<=r;i++){
for(int j=1;j<=c;j++){
if(i>1){
dp[i][j][0]=max(dp[i][j][0],max(dp[i-1][j][1],max(dp[i-1][j][2],dp[i-1][j][3])));
}
if(j>1){
                dp[i][j][0] = maxl(dp[i][j][0],dp[i][j-1][0]);
                dp[i][j][1] = maxl(dp[i][j][1],dp[i][j-1][1]);
                dp[i][j][2] = maxl(dp[i][j][2],dp[i][j-1][2]);
                dp[i][j][3] = maxl(dp[i][j][3],dp[i][j-1][3]);
}
             if(arr[i-1][j-1]>0){
dp[i][j][1]=max(dp[i][j][1],dp[i-1][j-1][0]+arr[i-1][j-1]);
dp[i][j][2]=max(dp[i][j][2],dp[i-1][j-1][1]+arr[i-1][j-1]);
dp[i][j][3]=max(dp[i][j][3],dp[i-1][j-1][2]+arr[i-1][j-1]);
}
}
}
cout<<max(dp[r][c][0],max(dp[r][c][1],max(dp[r][c][2],dp[r][c][3])))<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: 'maxl' was not declared in this scope; did you mean 'fmaxl'?
   20 |                 dp[i][j][0] = maxl(dp[i][j][0],dp[i][j-1][0]);
      |                               ^~~~
      |                               fmaxl
Language: Java

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

import java.util.Scanner;
import java.util.StringTokenizer; 

public class a {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		char[] ch=br.readLine().toCharArray();
		int ans=0;
		int ptr1=0;
		while(ptr1<ch.length) {
			int tmp=0;
			while(ptr1<ch.length && ch[ptr1]=='R') {
				tmp++; ptr1++;
			}
			if(ptr1<ch.length && ch[ptr1]=='S') ptr1++;
			ans=Math.max(ans,tmp);
		}
		System.out.println(ans);
	}

}

Compiler output:
Main.java:8: 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;
    if(S[0]=="R" && S[1]=="R" && S[2]=="R"){
      cout << "3";
    }else if((S[0]=="R" && S[1]=="R") || (S[1]=="R" && S[2]=="R")){
      cout << "2";
    }else if(S[0]=="S" && S[1]=="S" && S[2]=="S"){
      cout << "0";
    }else{
      cout << "1";
  }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |     if(S[0]=="R" && S[1]=="R" && S[2]=="R"){
a.cc:7:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |     if(S[0]=="R" && S[1]=="R" && S[2]=="R"){
a.cc:7:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |     if(S[0]=="R" && S[1]=="R" && S[2]=="R"){
a.cc:9:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     }else if((S[0]=="R" && S[1]=="R") || (S[1]=="R" && S[2]=="R")){
a.cc:9:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     }else if((S[0]=="R" && S[1]=="R") || (S[1]=="R" && S[2]=="R")){
a.cc:9:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     }else if((S[0]=="R" && S[1]=="R") || (S[1]=="R" && S[2]=="R")){
a.cc:9:60: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     }else if((S[0]=="R" && S[1]=="R") || (S[1]=="R" && S[2]=="R")){
a.cc:11:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     }else if(S[0]=="S" && S[1]=="S" && S[2]=="S"){
a.cc:11:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     }else if(S[0]=="S" && S[1]=="S" && S[2]=="S"){
a.cc:11:44: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     }else if(S[0]=="S" && S[1]=="S" && S[2]=="S"){
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"SSS"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |   if(s="SSS")
      |      ~^~~~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:15:9: error: 'consec' was not declared in this scope; did you mean 'const'?
   15 |   cout<<consec;
      |         ^~~~~~
      |         const
Language: C

#include<stdio.h>
int main(){
  int r,s,a,b,c,w,i;
  char p[200]={};
  scanf("%s",p);
  for(i=0;i<=3;i++){
    if('R'==p[i]){
      w++;
    }
    printf("%d",w)
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:19: error: expected ';' before '}' token
   10 |     printf("%d",w)
      |                   ^
      |                   ;
   11 |   }
      |   ~
Language: C

#include<stdio.h>
int main(){
  int r,s,a,b,c,w,i;
  char p[200]={};
  scanf("%s",p);
  for(i=0;i<=3;i++;){
    if('R'==p[i]){
      w++;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:19: error: expected ')' before ';' token
    6 |   for(i=0;i<=3;i++;){
      |      ~            ^
      |                   )
Language: C

#include<stdio.h>
int main(){
  int r,s,a,b,c,w;
  char p[200]={};
  scanf("%s",p);
  for(i=0;i<=3;i++;){
    if('R'==p[i]){
      w++;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i=0;i<=3;i++;){
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:19: error: expected ')' before ';' token
    6 |   for(i=0;i<=3;i++;){
      |      ~            ^
      |                   )
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before 'max'
   10 | if(s[i]=='R'
      |             ^
      |             ;
   11 | max++;
      | ~~~          
a.cc:12:1: error: expected primary-expression before 'else'
   12 | else
      | ^~~~
a.cc:11:7: error: expected ')' before 'else'
   11 | max++;
      |       ^
      |       )
   12 | else
      | ~~~~   
a.cc:10:3: note: to match this '('
   10 | if(s[i]=='R'
      |   ^
Language: C

#include<stdio.h>
int main(){
  int R,S,a,b,c,w;
  scanf("%s",w);
  if(w==RRR){
    printf("3");
  }
  if(w==RRS){
    printf("2");
  }
  if(w==RSS){
    printf("1");
  }
  if(w==RSR){
    printf("1");
  }
  if(w==SSS){
    printf("0");
  }
  if(w==SSR){
    printf("1");
  }
  if(w==SRR){
    printf("2");
  }
  if(w==SRS){
    printf("1");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'RRR' undeclared (first use in this function)
    5 |   if(w==RRR){
      |         ^~~
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:9: error: 'RRS' undeclared (first use in this function)
    8 |   if(w==RRS){
      |         ^~~
main.c:11:9: error: 'RSS' undeclared (first use in this function)
   11 |   if(w==RSS){
      |         ^~~
main.c:14:9: error: 'RSR' undeclared (first use in this function)
   14 |   if(w==RSR){
      |         ^~~
main.c:17:9: error: 'SSS' undeclared (first use in this function)
   17 |   if(w==SSS){
      |         ^~~
main.c:20:9: error: 'SSR' undeclared (first use in this function)
   20 |   if(w==SSR){
      |         ^~~
main.c:23:9: error: 'SRR' undeclared (first use in this function)
   23 |   if(w==SRR){
      |         ^~~
main.c:26:9: error: 'SRS' undeclared (first use in this function)
   26 |   if(w==SRS){
      |         ^~~
Language: C

#include<stdio.h>
int main(){
  int R,S,a,b,c,w;
  scanf("%d",w);
  if(w==RRR){
    printf("3");
  }
  if(w==RRS){
    printf("2");
  }
  if(w==RSS){
    printf("1");
  }
  if(w==RSR){
    printf("1");
  }
  if(w==SSS){
    printf("0");
  }
  if(w==SSR){
    printf("1");
  }
  if(w==SRR){
    printf("2");
  }
  if(w==SRS){
    printf("1");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'RRR' undeclared (first use in this function)
    5 |   if(w==RRR){
      |         ^~~
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:9: error: 'RRS' undeclared (first use in this function)
    8 |   if(w==RRS){
      |         ^~~
main.c:11:9: error: 'RSS' undeclared (first use in this function)
   11 |   if(w==RSS){
      |         ^~~
main.c:14:9: error: 'RSR' undeclared (first use in this function)
   14 |   if(w==RSR){
      |         ^~~
main.c:17:9: error: 'SSS' undeclared (first use in this function)
   17 |   if(w==SSS){
      |         ^~~
main.c:20:9: error: 'SSR' undeclared (first use in this function)
   20 |   if(w==SSR){
      |         ^~~
main.c:23:9: error: 'SRR' undeclared (first use in this function)
   23 |   if(w==SRR){
      |         ^~~
main.c:26:9: error: 'SRS' undeclared (first use in this function)
   26 |   if(w==SRS){
      |         ^~~