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

#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}






int gcd(int a,int b)
{
 
  int r, tmp;
 
  
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
 
 
  return b;
}







int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  string s;
  cin>>s;
  
  vector<int> v;
  int cnt=0,start;
  bool flag=true;
  for(long long int=0;i<s.size();i++){
    if(flag){
      start=i;
      flag=false;
    }
    if(s[i]==s[i+1]){
      cnt++;
    }else{
      v.push_back(s.substr(start,cnt+1));
      cnt=0;
      flag=true;
    }
  }
  cout<<v.size()-1<<endl;
}
///////////////////////////

Compiler output:
a.cc: In function 'int main()':
a.cc:76:20: error: expected unqualified-id before '=' token
   76 |   for(long long int=0;i<s.size();i++){
      |                    ^
a.cc:76:20: error: expected ';' before '=' token
   76 |   for(long long int=0;i<s.size();i++){
      |                    ^
      |                    ;
a.cc:76:20: error: expected primary-expression before '=' token
a.cc:76:23: error: 'i' was not declared in this scope
   76 |   for(long long int=0;i<s.size();i++){
      |                       ^
a.cc:76:33: error: expected ')' before ';' token
   76 |   for(long long int=0;i<s.size();i++){
      |      ~                          ^
      |                                 )
a.cc:76:34: error: 'i' was not declared in this scope
   76 |   for(long long int=0;i<s.size();i++){
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
char x[100005],y;
int g,z;
int main()
{
	while(x[z]=getchar(),x[z]!='\n')
	{
		
		if(z==0),y=x[z];
		if(x[z]!=y)g++,y=x[z];
		
		z++;
	}
	
	cout<<g;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: expected primary-expression before ',' token
   10 |                 if(z==0),y=x[z];
      |                         ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  string s;
  cin >> s;
  
  
  bool f = false;
  int ans = 0;
  while(!f){
    //先頭から同じ要素がいくつ続いているか
    int cl = 1;
    for(int i = 1; i < s.size(); i++){
      if(s[0] != s[i]) break;
      cl++;
    }
    if(cl == s.size()){
      f = true;
      continue;
    }
    cr = 1;
    //末尾から(略
    for(int i = s.size() -1 ; i >= 0; i--){
      if(s[s.size() - 1] != s[i]) break;
      cr++;
    }
    if(cr == s.size()){
      f = true;
      continue;
    }
    
    if(cl > cr){
      ans++;
      auto b = s.begin();
      if(s[0] == 'B'){
        s.insert(b,'W');
        for(int i = 1; i < cl+1; i++) s[i] = 'W';
      }else{
        s.insert(b,'B');
        for(int i = 1; i < cl+1; i++) s[i] = 'B';
      }
    }else{
      ans++;
      if(s[s.size()-1] == 'B'){
        s.push_back('W');
        for(int i = s.size()-1; i > s.size()-cr-1; i--) s[i] = 'W';
      }else{
        s.push_back('B');
        for(int i = s.size()-1; i > s.size()-cr-1; i--) s[i] = 'B';
      }
    }
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'cr' was not declared in this scope; did you mean 'cl'?
   24 |     cr = 1;
      |     ^~
      |     cl
Language: C++

#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
    string a;
    int sum=0;
    cin>>a;
    for(int i=1;i<a.length;i++){
        if(a[i]!=a[i-1]){
            sum++;
        }
    }
    cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |     for(int i=1;i<a.length;i++){
      |                   ~~^~~~~~
      |                           ()
Language: C++

#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
char asd[100001];
int main()
{
    gets(asd);
    int zip,ppt=0;
    for(zip=1;zip<strlen(asd);zip++)
    if(asd[zip]!=asd[zip-1])
    ppt++;
    printf("%d\n",ppt);
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
char asd[100001];
int main()
{
    gets(asd);
    int zip,ppt=0;
    for(zip=1;zip<strlen(asd);zip++)
    if(asd[zip]!=asd[zip-1])
    ppt++;
    printf("%d\n",ppt);
    return 0;
}

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

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

int main(){
	string s;
	cin >> s;
	char tmp = s[0];
	int count = 0;
	for(int i = 1; i < s.size(); i++){
		if(s[i] != tmp) {
			count++;
			tmp = s[i];
		}
	}
	cout << cont;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int ans;
    char a[100001];
    scanf("%s",a);
    for(int i=0;i<a-1;i++)
    {
        if(a[i]!=a[i+1])
            ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     for(int i=0;i<a-1;i++)
      |                 ~^~~~
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
int main(){
	char a[100010];
	int ans=0;
	gets(a);
	for(int i=1;i<=strlen(a);i++){
		if(a[i]!=a[i-1]) ans++;
	}
	cout<<ans-1;
	return 0;
}


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

#include<vector>
#include<cstring>
#include<iostream>
using namespace std;
string s;
int main()
{
	int ans=0;
	getline(cin,s);
	for(int i=1;i<s.size();i++)
		if(s[i]!=s[i-1])ans++;
	printf("%d\N",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: '\N' not followed by '{'
   12 |         printf("%d\N",ans);
      |                ^~~~~~
a.cc:12:16: error: incomplete universal character name \N
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int cnt=0;
  for(int i=0;i<s.size()-1;i++){
    if(a[i]!=a[i+1]){
      cnt++;
    }
  }
  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'a' was not declared in this scope
    8 |     if(a[i]!=a[i+1]){
      |        ^
Language: C++

#include<cstdio>
#include<cstring>
int main(){
  char s[];
  scanf("%s", s);
  
  int n = 0;
  for(int i=0; i<strlen(s); i++){
    if(s[i] != s[i-1])
      n++;
  }
  printf("%d", n);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:8: error: storage size of 's' isn't known
    4 |   char s[];
      |        ^
Language: C++

#include"bits/stdc++.h"
#define int long long
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
#define gridif(a,x,b) if((a)<=(x)&&(x)<(b))
using namespace std;
typedef pair<int,int> P;
const int mod=1000000007;

int digitsum(int n,int b){
	if(b<2) return -1;
	if(n<b) return n;
	return digitsum(n/b,b)+n%b;
}
int mpow(int a,int x);
int m_inv(int n){return mpow(n,mod-2);}

int gcd(int x,int y){return y?gcd(y,x%y):x;}
int lcm(int x,int y){return x*y/gcd(x,y);}

signed main(){
    string S;
    cin>>S;
    int ans=0;
    rep(i,s.size()-1) if(s[i]!=s[i+1]) ans++;
    cout<<ans<<endl;
}

int mpow(int a,int x){
	int ans=1;
	while(x>0){
		if(x%2==1) (ans*=a)%=mod;
		(a*=a)%=mod;
		x>>=1;
	}
	return ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:11: error: 's' was not declared in this scope
   29 |     rep(i,s.size()-1) if(s[i]!=s[i+1]) ans++;
      |           ^
a.cc:5:38: note: in definition of macro 'repi'
    5 | #define repi(i,a,b) for(int i=(a);i<(b);++i)
      |                                      ^
a.cc:3:39: note: in expansion of macro '_rep'
    3 | #define _overload3(_1,_2,_3,name,...) name
      |                                       ^~~~
a.cc:29:5: note: in expansion of macro 'rep'
   29 |     rep(i,s.size()-1) if(s[i]!=s[i+1]) ans++;
      |     ^~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  string s;
  cin >> s;
  int ans = 0;
  for(int i = 0; i<= s.length()-2;i++){
    char a = s[i];
    char b = s[i+1]
    if(a != b){
      ans++;
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'if'
   11 |     if(a != b){
      |     ^~
Language: C++

#include<bits/stdc++.h>
using nmaespace std;
int main(){
    string input;
    long long ans=0;
    cin>>input;
    for(int i=1;i<input.length();i++){
        if(input[i-1]!=input[i])  ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nmaespace'
    2 | using nmaespace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:5: error: 'string' was not declared in this scope
    4 |     string input;
      |     ^~~~~~
a.cc:4:5: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin>>input;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'input' was not declared in this scope; did you mean 'int'?
    6 |     cin>>input;
      |          ^~~~~
      |          int
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     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:10:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |     cout<<ans<<endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char srx[100001];
int main()
{
    gets(srx);
    int i,zjq=0;
    for(i=1;i<strlen(srx);i++)//注意从1开始，不然就会多一个
    if(srx[i]!=srx[i-1])
    zjq++;//判断成功就加1（还是C语言的char好用~，可以当数组用）
    printf("%d\n",zjq);//回车注意++
    return 0;
}

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

#include<iostream>
using namespace std; 
int main()
{
	char i[100001]="0",c=0;
	cin>>i;
	for(int j=1;i[j]!='\0';i++) if(i[j]!=i[j-1]) c++;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: lvalue required as increment operand
    7 |         for(int j=1;i[j]!='\0';i++) if(i[j]!=i[j-1]) c++;
      |                                ^
Language: C++

#include<bits/stdc++.h>
string st;
int ans;
int main()
{
    cin>>st;
    for(int i=1;i<st.size();i++)
    if(st[i]!=st[i-1])
    ans++;
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string st;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin>>st;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'st' was not declared in this scope; did you mean 'std'?
    6 |     cin>>st;
      |          ^~
      |          std
Language: C++

#include<bits/stdc++.h>
#include<stdio.h>
#include<string.h>
char ch[100001];
int ans;
int main()
{
    gets(ch);
    for(int i=1;i<strlen(ch);i++)
    if(ch[i]!=ch[i-1])
    ans++;
    printf("%d\n",ans);
    return 0;
}

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

#include<bits/stdc++.h>
char ch[100001];
int ans;
int main()
{
    gets(ch);
    for(int i=1;i<strlen(ch);i++)
    if(ch[i]!=ch[i-1])
    ans++;
    printf("%d\n",ans);
    return 0;
}

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

#include<bits/stdc++.h>
char ch[100001];
int ans;
int main()
{
    gets(ch):
    for(int i=1;i<strlen(ch);i++)
    if(ch[i]!=ch[i-1])
    ans++;
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(ch):
      |     ^~~~
      |     getw
a.cc:7:17: error: 'i' was not declared in this scope
    7 |     for(int i=1;i<strlen(ch);i++)
      |                 ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
	char S[100000] = {};
	cin >> S;

	int S_len = 0;;

	for (S_len = 0; S_len < 100000; S_len++)
	{
		if (S[S_len] == NULL)
		{
			break;
		}
	}

	int now_index = 0;
	int count = 0;

	for (int i = 1; i < S_len; i++)
	{
		if (strcmp(&S[now_index], &S[i]) != 0)
		{
			for (int j = now_index+1; j <= i; j++)
			{
				S[j + 1] = S[now_index];
			}
			now_index = i;
			count++;
		}
	}

	cout << count;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: warning: NULL used in arithmetic [-Wpointer-arith]
   15 |                 if (S[S_len] == NULL)
      |                                 ^~~~
a.cc:26:21: error: 'strcmp' was not declared in this scope
   26 |                 if (strcmp(&S[now_index], &S[i]) != 0)
      |                     ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main() {
  string s;
  cin >> s;
  int ans=0;
  for(int i=0; i<s.length()-1; i++) {
    if(s[i]!=s[i+1]) {
      ans++;
    }
    cout << ans << endl;
}


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

#include<bits/stdc++.h>
using namespase std;
int main(){
  int ans = 0;
  string S;
  cin >> S;
  
  for(int i=1; i<S.length(); i++){
    if(S[i]!=S[i-1]){
      ans++;
    }
  }
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string S;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> S;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'S' was not declared in this scope
    6 |   cin >> S;
      |          ^
a.cc:14:3: 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:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    char n[];
    int jsq=0,len;
    scanf("%s",&n);
    len=strlen(n);
    for(int i=1;i<len;i++)
    {
        if(n[i]!=n[i+1])jsq++;
    }
    printf("%d",jsq);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: storage size of 'n' isn't known
    6 |     char n[];
      |          ^
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    char n[];
    int jsq=0,len;
    scanf("%s",&n);
    len=strlen(n)；
    for(int i=1;i<len;i++)
    {
        if(n[i]!=n[i+1])
        jsq++;
    }
    printf("%d",jsq);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: storage size of 'n' isn't known
    6 |     char n[];
      |          ^
a.cc:10:17: error: 'i' was not declared in this scope
   10 |     for(int i=1;i<len;i++)
      |                 ^
Language: C++

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

int main(){
    string s;
    cin >> s;
    int ans = 0;
    for(int i = 1;i < s.length();i++){
        if(s[i] != s[i-1])  ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: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.h>
using namespace std;
int main()
{
	int i,n,sum=0;
	char a[10010];
	gets(a);
	n=strlen(a);
	for(i=0;i<n-1;i++)
	{
		if(a[i]!=a[i+1])sum++;
	}
	cout<<sum<<endl;
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int count=0;
		Scanner sc=new Scanner(System.in);
		String s;
		s=sc.nextLine();
		for(int i=1;i<s.length();i++) {
			if(s.charAt(i)!=s.charAt(i-1))count++;
		}
		System.out.println(count);
	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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



int main () {
    string s;
    int a,i,y,x,W,H,N,num=0;
    cin >> s;
    for (i=0;i<s.size()-1;i++)
        if (s[i]!=s[i+1]) num++;
    cout << num << endl;

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



int main () {
    string s;
    int a,i,y,x,W,H,N,num=0;
    cin >> s;
    for (i=0;i<s.size()-1;i++)
        if (s[i]!=s[i+1]) num++;
    cout << num << endl;

    return 0;
}

Compiler output:
a.cc:15:2: error: stray '#' in program
   15 | }#include <bits/stdc++.h>
      |  ^
a.cc:15:3: error: 'include' does not name a type
   15 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:20:5: error: redefinition of 'int main()'
   20 | int main () {
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main () {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
int main(){
    std::string s;
    cin>>s;
    long count=0;
    for(int i=1; i<s.size(); i++){
        if(s[i]!=s[i-1])
            count++;
    }
    cout<<count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin>>s;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout<<count;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.nextInt();
        int len = s.length();
        StringBuilder sb = new StringBuilder();
        int left = 0;
        while(left<len){
            int right = left+1;
            while(right<N&&s.charAt(right)==s.charAt(left)) right++;
            sb.append(s.charAt(left));
            left=right;
        }
        String res = sb.toString();
        System.out.println(res.length()-1);
    }
}


Compiler output:
Main.java:6: error: incompatible types: int cannot be converted to String
        String s = sc.nextInt();
                             ^
Main.java:12: error: cannot find symbol
            while(right<N&&s.charAt(right)==s.charAt(left)) right++;
                        ^
  symbol:   variable N
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
char s[100001];
int main()
{
    gets(s);
    int ans=0;
    for(int i=1;i<strlen(s);i++)
    if(s[i]!=s[i-1])
    ans++;
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |     gets(s);
      |     ^~~~
      |     getw
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout<<ans<<endl;
      |     ^~~~
      |     std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |     cout<<ans<<endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

string s;
int count=0;

int main()
{
    cin>>s;
    char k=s[0];
    for(int i=1; i<s.length(); i++)
    {
        if(s[i]!=k)  count++;
        k=s[i];
    }
    printf("%d\n",count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: reference to 'count' is ambiguous
   14 |         if(s[i]!=k)  count++;
      |                      ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:6:5: note:                 'int count'
    6 | int count=0;
      |     ^~~~~
a.cc:17:19: error: reference to 'count' is ambiguous
   17 |     printf("%d\n",count);
      |                   ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:6:5: note:                 'int count'
    6 | int count=0;
      |     ^~~~~
Language: C++

#include<cstdio>
char s[1e5+5];
int ans;
int main(){
    scanf("%s",s);
    for(int i=1;s[i];i++)
    if(s[i]!=s[i-1])ans++;
    printf("%d\n",ans);
}

Compiler output:
a.cc:2:11: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    2 | char s[1e5+5];
      |        ~~~^~
a.cc:2:11: error: could not convert '(1.0e+5 + (double)5)' from 'double' to 'long unsigned int'
    2 | char s[1e5+5];
      |        ~~~^~
      |           |
      |           double
a.cc:2:11: error: size of array 's' has non-integral type 'double'
Language: C

#include <stdio.h>int main() {
	char s[100010];
	int x = 0;
	scanf("%s", s);
	for (int i = 1; s[i] != '\0'; i++)
	{
		if (s[i - 1] != s[i]) {
			x++;
		}
	}
	printf("%d", x);
	return 0;
}

Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>int main() {
      |                   ^~~
main.c:4:15: error: expected declaration specifiers or '...' before string constant
    4 |         scanf("%s", s);
      |               ^~~~
main.c:4:21: error: expected declaration specifiers or '...' before 's'
    4 |         scanf("%s", s);
      |                     ^
main.c:5:9: error: expected identifier or '(' before 'for'
    5 |         for (int i = 1; s[i] != '\0'; i++)
      |         ^~~
main.c:5:27: error: 'i' undeclared here (not in a function)
    5 |         for (int i = 1; s[i] != '\0'; i++)
      |                           ^
main.c:5:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
    5 |         for (int i = 1; s[i] != '\0'; i++)
      |                              ^~
main.c:5:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    5 |         for (int i = 1; s[i] != '\0'; i++)
      |                                        ^~
main.c:11:16: error: expected declaration specifiers or '...' before string constant
   11 |         printf("%d", x);
      |                ^~~~
main.c:11:22: error: expected declaration specifiers or '...' before 'x'
   11 |         printf("%d", x);
      |                      ^
main.c:12:9: error: expected identifier or '(' before 'return'
   12 |         return 0;
      |         ^~~~~~
main.c:13:1: error: expected identifier or '(' before '}' token
   13 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#include<queue>
#include<algorithm>
using namespace std;

bool flag = true;
queue<char> que;
char fr, fr2;

void i_judge()
{	
	flag = true;
	fr = que.front();
	while(flag)
	{	
		que.pop();
		if(que.front() == fr)
			flag = true;
		else
			flag = false;
	}	
}

int main()
{
	char s[100005];
	
	scanf("%s", &s);
	int len = strlen(s);
	for(int i = 0; i < len; i++)
		que.push(s[i]);

	int num = 0;
	int cou = 10;
	int ans = 0;
	while(1)
	{	
		fr2 = que.front();	
		i_judge();
			
		if(!que.size())
			break;
			
		for(int i = 0; i < que.size(); i++)
		{
			if(que.front() == 'W')
			{
				que.push('B');
			}
			else if(que.front() == 'B')
			{
				que.push('W');
			}
			que.pop();
		}	
		que.push(s[ans++]);
		num++;
	}
	printf("%d\n", num);
	
	return 0;
}

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

#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;

bool flag = true;
queue<char> que;
char fr, fr2;

void i_judge()
{	
	flag = true;
	fr = que.front();
	while(flag)
	{	
		que.pop();
		if(que.front() == fr)
			flag = true;
		else
			flag = false;
	}	
}

int main()
{
	char s[100005];
	
	scanf("%s", &s);
	int len = strlen(s);
	for(int i = 0; i < len; i++)
		que.push(s[i]);

	int num = 0;
	int cou = 10;
	int ans = 0;
	while(1)
	{	
		fr2 = que.front();	
		i_judge();
			
		if(!que.size())
			break;
			
		for(int i = 0; i < que.size(); i++)
		{
			if(que.front() == 'W')
			{
				que.push('B');
			}
			else if(que.front() == 'B')
			{
				que.push('W');
			}
			que.pop();
		}	
		que.push(s[ans++]);
		num++;
	}
	printf("%d\n", num);
	
	return 0;
}

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

#include<cstdio>
#include<cstring>
int main()
{
    char a[10004];
    gets(a);
    int l=strlen(a);
    int ant=0;
    for(int i=1;i<l;i++)
    {
    	if(a[i]!=a[i-1])
    	ant++;
	}
	printf("%d\n",ant);
return 0;
}

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

import java.util.Scanner;

public class ICPC_8_P4 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String game = sc.nextLine();
		int reqMoves = 0;
		if (game.length() > 1) {
			for (int i = 0; i < game.length() - 1; i++) {
				if (game.charAt(i) != game.charAt(i + 1)) {
					reqMoves++;
				}
			}
		}
		System.out.println(reqMoves);
	}
}


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

#include <bits/stdc++.h>

using namespace std;


int main() { 
    string s;
    while (cin >> s) {
        int n = s.length();
        int cnt = 0;
        for (int i = 1; i < n: ++i) {
            if (s[i] != s[i-1]) ++cnt;
        }
        cout << cnt << "\n";
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   11 |         for (int i = 1; i < n: ++i) {
      |                         ^
a.cc:11:30: error: expected ';' before ':' token
   11 |         for (int i = 1; i < n: ++i) {
      |                              ^
      |                              ;
a.cc:15:5: error: expected primary-expression before '}' token
   15 |     }
      |     ^
a.cc:14:29: error: expected ')' before '}' token
   14 |         cout << cnt << "\n";
      |                             ^
      |                             )
   15 |     }
      |     ~                        
a.cc:11:13: note: to match this '('
   11 |         for (int i = 1; i < n: ++i) {
      |             ^
a.cc:15:5: error: expected primary-expression before '}' token
   15 |     }
      |     ^
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] c = S.toCharArray();
		int N = S.length();
		int cnt = 0;
		for(int i = 0 ; i < N - 1 ; i++) {
			if(c[i] != c[i + 1]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
int i, j, k = 0, l, m, n;
using namespace std;
char S[100055], T[100055];
using namespace std;
int main() {
	gets(S);
	n = strlen(S);
	for(i = 1; i < n; i++) {
		if(S[i] != S[i-1]) ++l;
	}
	printf("%d\n", l);
}

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

#include<cstdio>
#include<cstring>
char s[100];
int ac,a,b,c,d;
int main(){
	gets(s);
	int len=strlen(s);
	d=0; a=b=0;
	for (int i=0; i<len; i++){
		if (s[i]>='0'&&s[i]<='9'){
			if (!d) a=a*10+s[i]-48;
			else b=b*10+s[i]-48;
		}
		else if (s[i]=='+') c=1,d=1;
		else if (s[i]=='-') c=-1,d=1;
	}
	printf("%d\n",a+c*b);
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	int res = 1;
	bool flag;
	cin >> s;
	int len = s.size()
	if (s[0] == 'B')
		flag = 0;
	else
		flag = 1;
	for (int i = 1; i < len; ++i)
	{
		if ((s[i] == 'B') && (!flag))
			continue;
		else if ((s[i] == 'W') && (flag))
			continue;
		else
		{
			res++;
			flag = (s[i]=='B')?0:1;
		}
	}
	return res - 1;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected ',' or ';' before 'if'
   10 |         if (s[0] == 'B')
      |         ^~
a.cc:12:9: error: 'else' without a previous 'if'
   12 |         else
      |         ^~~~
Language: C++

#include <iostream>
int main()
{
          string s;
cin>>s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: 'string' was not declared in this scope
    4 |           string s;
      |           ^~~~~~
a.cc:4:11: 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;
      |      ^
Language: C++

#include <bits/stdc++.h>

#define get_variable_name(x) #x
#define debug(x) cout << #x << " = " << x << endl
#define rep(i,n) for(int (i) = 0; (i) < (n); (i)++)

#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort((x).begin(), (x).end())
#define REVERSE(x) reverse( (x).begin(),(x).end())
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define PW(x) (1LL<<(x))

using namespace std;
using ll = int64_t;
using P = pair<int, int>;

template<class T,class U>
ostream& operator<<(ostream &os, const pair<T, U> &p) {
    os << get_variable_name(p) << " = (" << p.first <<", " << p.second << ")";
    return os;
}

template<class T>
ostream& operator <<(ostream& os, const vector<T> &v){
    cout << get_variable_name(v) << " = [";
    for(auto i : v) 
        os << " " << i;
    os << " ]";
    return os;
}


const int INF = 1e8;

int main() {
    ios::sync_with_stdio(false);
    string S;
    cin >> s;
    int ans = 0;
    char prev = s[0];
    for(int i = 1; i < s.size(); i++) {
        ans += (prev != s[i]);
        prev = s[i];
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: 's' was not declared in this scope
   38 |     cin >> s;
      |            ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>
#include <copy>


#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;


template <typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v){
    if(!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}

template <typename T1, typename T2>
std::ostream &operator<<(std::ostream &out, const std::pair<T1, T2> &p) {
    out << "[" << p.first << ", " << p.second << "]";
    return out;
}
//---------


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //CLion Standard Input
//    ifstream in("/Users/ryo/Dropbox/competition/CompetionIDE/in.txt");
//    cin.rdbuf(in.rdbuf());

    string ss;
    cin >> ss;
    ll ans = 0;
    rep(i, 1, ss.size()){
        if(!(ss[i-1] == ss[i])) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>


#define rep(i,a,n) for(int i=a;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;


template <typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v){
    if(!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}

template <typename T1, typename T2>
std::ostream &operator<<(std::ostream &out, const std::pair<T1, T2> &p) {
    out << "[" << p.first << ", " << p.second << "]";
    return out;
}
//---------


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //CLion Standard Input
//    ifstream in("/Users/ryo/Dropbox/competition/CompetionIDE/in.txt");
//    cin.rdbuf(in.rdbuf());

    string ss;
    cin >> ss;
    ll ans = 0;
    rep(i, 1, ss.size()){
        if(!(ss[i-1] == ss[i])) ans++;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)':
a.cc:26:44: error: 'ostream_iterator' is not a member of 'std'
   26 |         std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
      |                                            ^~~~~~~~~~~~~~~~
a.cc:14:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
   13 | #include <fstream>
  +++ |+#include <iterator>
   14 | 
a.cc:26:62: error: expected primary-expression before '>' token
   26 |         std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
      |                                                              ^
Language: C++

// cpp_console.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <string>
#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	string s;
	char h;
	int cnt = 0;
	cin >> s;
	if(s[0] == s[s.length ()- 1]){
		h = s[0];
		for(int i = 1; i < s.length(); ++i){
			if(h == s[i]){
				++cnt;
			}
		}
		cnt = cnt * 2 - 1;
	}else{
		int b = 0;
		for(int i = 0; i < s.length(); ++i){
			if(s[i] == 'B'){
				++b;
			}
		}
		if(b >= (s.length() / 2)){
			cnt = (s.length() - b) * 2 - 1;
		}else{
			cnt = b * 2 - 1;
		}
	}
	cout << cnt << endl;
	return 0;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

public class Main {

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String board = scanner.next();
        int stop = 0;
        char last = board.charAt(0);
        for (int i = 0; i < board.length(); i++) {
            if (last != board.charAt(i)){
                stop ++;
                last = board.charAt(i);
            }
        }

        System.out.println(stop);
    }
}


Compiler output:
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <string>
#include <iostream>

string osero;
char flag;
int answer = 0;

int main(){
	cin >> osero;
	flag = osero[0];
	for (int i = 1; i < osero.size(); ++i){
		if (osero[i] != flag){
			answer++;
			flag = osero[i];
		}
	}
	printf("%d\n", answer);
	return  0;
}

Compiler output:
a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
    4 | string osero;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         cin >> osero;
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:16: error: 'osero' was not declared in this scope
    9 |         cin >> osero;
      |                ^~~~~
Language: C++

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

int main() {
	char s[100000];
	size_t str=strlen(s);
	scanf("%s",s);
	int count=;0;
	for(int i=0;i<str-1;i++){
		for(j=i+1;j<str;j++){
			if(s[i]!=s[j]){
				count++;
			}
		}
	}
	cout<<count-1<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected primary-expression before ';' token
    9 |         int count=;0;
      |                   ^
a.cc:11:21: error: 'j' was not declared in this scope
   11 |                 for(j=i+1;j<str;j++){
      |                     ^
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
	int x=0;
	char s[100001];
	cin >> s;
	for(int i=1;i<strlen(s);i++)
	{
		if(s[i] != s[i-1])
		{
			x++;
		}
	}
	cout << x;
}

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

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <string>
using namespace std;

int main() {
    char S[100000];
    scanf("%s", S);

    int change = 0;
    char c = S[0];
    for (int i = 1; i < strlen(S); i++)
    {
        if (c != S[i]) change++;
        c = S[i];
    }

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


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

#include <iostream>
#include <string>
using namespace std;
int main()
{
   char S[100000];
   cin >> S;
   int N = strlen(S);
   int cnt = 0;
   for (int i = 1; i < N; i++){
       if (S[i] != S[i-1]) {
           cnt++;
       }
   }
   cout << cnt << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'strlen' was not declared in this scope
    8 |    int N = strlen(S);
      |            ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
using namespace std;
int main()
{
   char S[100000];
   cin >> S;
   int N = strlen(S);
   int cnt = 0;
   for (int i = 1; i < N; i++){
       if (S[i] != S[i-1]) {
           cnt++;
       }
   }
   cout << cnt << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'strlen' was not declared in this scope
    7 |    int N = strlen(S);
      |            ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;