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

#include<iostream>
#include<string>

int main(void){
  int N,ans=1;
  string S;
  cin>>N;
  cin>>S;
  for(int i=0;i<N;i++){
  if(S[i]!=S[i+1])ans++;
    }
  cout<<ans<<endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>N;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:8: error: 'S' was not declared in this scope
    8 |   cin>>S;
      |        ^
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   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:12:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   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<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
using namespace std;

#define MAX_N 100000000
#define INF 100000000000000

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:29: error: expected ';' before ':' token
   25 |     if(s[i] != s[i+1]) ans++:
      |                             ^
      |                             ;
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main()
{
 int i,n,c;
 c=1;
 string s;
 char p;
 cin >> n;
 cin >> s;
 for(i=0;i<(n-1);i++)
 {
  p=s.at(i);
  q=s.at(i+1);
  if(p!=q)
  c++;
 }
 cout << c;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'q' was not declared in this scope
   15 |   q=s.at(i+1);
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

int main(){
  int n;cin >> n;
  vector<int> a(n);
  for(auto &i:a) cin >> i;
  int ans = 0;
  rep(i,n-1){
    if(a[i]!+a[i+1]) ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: expected ')' before '!' token
   20 |     if(a[i]!+a[i+1]) ans++;
      |       ~    ^
      |            )
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    char b[] = new b[a];
    int counter;
    for(int i = 0;i < b.length;i++){
     b[i] = sc.nextChar();
    }
    for(int j = 0;j < b.length;j++){
      if(b[j-1]==b[j] && j != 0){
        counter++;
      }
    }
        System.out.println(a-couter);
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    char b[] = new b[a];
                   ^
  symbol:   class b
  location: class Main
Main.java:9: error: cannot find symbol
     b[i] = sc.nextChar();
              ^
  symbol:   method nextChar()
  location: variable sc of type Scanner
Main.java:16: error: cannot find symbol
        System.out.println(a-couter);
                             ^
  symbol:   variable couter
  location: class Main
3 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    char b[] = new b[a];
    int counter;
    for(int i = 0;i < b.length;i++){
     b[i] = sc.next();
    }
    for(int j = 0;j < b.length;j++){
      if(b[i-1]==b[i] && j != 0){
        counter++;
      }
    }
        System.out.println(a-couter);
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    char b[] = new b[a];
                   ^
  symbol:   class b
  location: class Main
Main.java:9: error: incompatible types: String cannot be converted to char
     b[i] = sc.next();
                   ^
Main.java:12: error: cannot find symbol
      if(b[i-1]==b[i] && j != 0){
           ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
      if(b[i-1]==b[i] && j != 0){
                   ^
  symbol:   variable i
  location: class Main
Main.java:16: error: cannot find symbol
        System.out.println(a-couter);
                             ^
  symbol:   variable couter
  location: class Main
5 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    char b[] = new b[a];
    int counter;
    for(int i = 0;i < b.length;i++){
     b[i] = sc.next();
    }
    for{int j = 0;j < b.length;j++){
      if(b[i-1]==b[i] && j != 0){
        counter++;
      }
    }
        System.out.println(a-couter);
  }
}


Compiler output:
Main.java:11: error: '(' expected
    for{int j = 0;j < b.length;j++){
       ^
Main.java:11: error: > or ',' expected
    for{int j = 0;j < b.length;j++){
                              ^
Main.java:11: error: not a statement
    for{int j = 0;j < b.length;j++){
                    ^
Main.java:11: error: ';' expected
    for{int j = 0;j < b.length;j++){
                                  ^
Main.java:18: error: reached end of file while parsing
}
 ^
5 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin>>N;
  string s;
  cin>>s;
  int ans=0;
  for(i=0,j=0;j<N;i=j)
  {
    while(j<N&&s[i]==s[j])
    {
      j++;
    }
    ans++;
  }
  cout<<ans<<endl;
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin>>N;
  string s;
  cin>>s;
  int ans=0;
  for(i=0,j=0;j<N;i=j)
  {
    while(j<N&&s[i]==s[j])
    {
      j++;
    }
    ans++;
  }
  return 0;
}

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

#include<bits/stdc++.h>

using namespace std;

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

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

#include <stdio.h>
#define MAX_N 100000

int main()
{
	int N;
	char S[MAX_N];
	int ans = 0;

	scanf("%d", &N);
	scanf("%s", S);

	char c = '0';

	for (int i = 0; i < N; ++i)
	{
		if (c == S[i])
		{
			continue;
		}

		else if (i == N-1)
		{
			ans++;
		}

		else
		{
			c = '0'
			ans ++;
			if (S[i] == S[i+1])
			{
				c = S[i];
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: expected ';' before 'ans'
   29 |                         c = '0'
      |                                ^
      |                                ;
   30 |                         ans ++;
      |                         ~~~     
a.cc:39:18: error: expected '}' at end of input
   39 |         return 0;
      |                  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++




if __name__ == "__main__":
  n = int(input())
  vals = list(input())
  # print(vals)
  res=1
  prev = vals[0]
  for idx, val in enumerate(vals[1:]):
    if val == prev:
      continue
    else:
      prev = val
      res += 1

  print(res)



Compiler output:
a.cc:7:5: error: invalid preprocessing directive #print
    7 |   # print(vals)
      |     ^~~~~
a.cc:4:1: error: expected unqualified-id before 'if'
    4 | if __name__ == "__main__":
      | ^~
Language: C++

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

int main()
{
  int n;
  string x;
  cin>>n>>x;
  queue<char>q;
  for(auto it:x) q.push(x);
  
  int ans=0;
  
  while(!q.empty())
  {
    char u=q.front();
    while(!q.empty() && q.front()==u) q.pop();
    ans++;
  }
  
  cout<<ans;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'std::queue<char>::push(std::string&)'
   10 |   for(auto it:x) q.push(x);
      |                  ~~~~~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = char; _Sequence = std::deque<char, std::allocator<char> >; value_type = char]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::queue<char>::value_type&' {aka 'const char&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = char; _Sequence = std::deque<char, std::allocator<char> >; value_type = char]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::queue<char>::value_type&&' {aka 'char&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: C

#include <stdio.h>
#include <math.h>
int main()
{
	int n;
	int ans=0;
	int flag=true;
	char slime[100000];
	scanf("%d",&n);
	scanf("%s",slime);
	for(int i=0;i<n-1;i++){
		if(slime[i]==slime[i+1]){ans++;flag=false;}
		else if(slime[i]!=slime[i+1])flag=true;
		//printf("%c %c = %d  ans=%d\n",slime[i],slime[i+1],flag,ans);
	}
	printf("%d",n-ans);
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: 'true' undeclared (first use in this function)
    7 |         int flag=true;
      |                  ^~~~
main.c:3:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <math.h>
  +++ |+#include <stdbool.h>
    3 | int main()
main.c:7:18: note: each undeclared identifier is reported only once for each function it appears in
    7 |         int flag=true;
      |                  ^~~~
main.c:12:53: error: 'false' undeclared (first use in this function)
   12 |                 if(slime[i]==slime[i+1]){ans++;flag=false;}
      |                                                     ^~~~~
main.c:12:53: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    string ch;
    cin>>ch;
    int cnt=1;
    int x=ch[0];
    for(int i=1;i<n;i++)
    {
        if(x!=ch[i])
        {
            x=ch[i];
            cnt++;
        }
    }
    cout<<cnt<<endl;x`
    return 0;
}


Compiler output:
a.cc:23:22: error: stray '`' in program
   23 |     cout<<cnt<<endl;x`
      |                      ^
a.cc: In function 'int main()':
a.cc:23:22: error: expected ';' before 'return'
   23 |     cout<<cnt<<endl;x`
      |                      ^
      |                      ;
   24 |     return 0;
      |     ~~~~~~
Language: C

var
	N,i,A:Longint;
	S:String;
begin
	readln(N);
	readln(S);
	for i:=1 to N do if S[i-1]<>S[i]then inc(A);
	writeln(A);
end.

Compiler output:
main.c:1:1: error: unknown type name 'var'
    1 | var
      | ^~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    2 |         N,i,A:Longint;
      |              ^
main.c:3:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    3 |         S:String;
      |          ^
main.c:4:1: error: unknown type name 'begin'
    4 | begin
      | ^~~~~
main.c:5:9: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
    5 |         readln(N);
      |         ^~~~~~
main.c:6:9: warning: data definition has no type or storage class
    6 |         readln(S);
      |         ^~~~~~
main.c:6:9: error: type defaults to 'int' in declaration of 'readln' [-Wimplicit-int]
main.c:6:9: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
main.c:7:9: error: expected identifier or '(' before 'for'
    7 |         for i:=1 to N do if S[i-1]<>S[i]then inc(A);
      |         ^~~
main.c:8:9: warning: data definition has no type or storage class
    8 |         writeln(A);
      |         ^~~~~~~
main.c:8:9: error: type defaults to 'int' in declaration of 'writeln' [-Wimplicit-int]
main.c:8:9: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
main.c:9:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    9 | end.
      |    ^
Language: C++

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

int main()
{
  int N;
  cin>>N;
  string S;
  cin>>S;
  len=S.size();
  len1=len;
  int i=0;
  while(1)
  {
  	if(S[i]==S[i+1] && i!=len-1)
    {
      len1--;
      i++;
      continue;
    }
    else if(S[i]!=S[i+1] && i!=len-1)
    {
      i++;
    }
    
    else
    {
      break;
    }
  }
  cout<<len;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'len' was not declared in this scope
   10 |   len=S.size();
      |   ^~~
a.cc:11:3: error: 'len1' was not declared in this scope
   11 |   len1=len;
      |   ^~~~
Language: C++

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

int main()
{
  int N;
  cin>>N;
  string S;
  cin>>S;
  len=S.size();
  int i=0;
  while(1)
  {
  	if(S[i]==S[i+1])
    {
      len--;
      i++;
      continue;
    }
    else
    {
      i++;
    }
    
    if(i==len-1)
    {
      break;
    }
  }
  cout<<len;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'len' was not declared in this scope
   10 |   len=S.size();
      |   ^~~
Language: C++

include<stdio.h>
#include<string.h>
int main()
{
  int a,i,j=0;
  char x[100000];
  scanf("%d",&a);
  for(i=1;i<=a;i++)
    {
      scanf("%c",&x[i]);
    }
  for(i=1;i<=a;i++)
    {
      if(x[i]!=x[i+1])
        {
          j++;
        }
    }
  printf("%d\n",j);
  return 0;
}





Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'scanf' was not declared in this scope
    7 |   scanf("%d",&a);
      |   ^~~~~
a.cc:19:3: error: 'printf' was not declared in this scope
   19 |   printf("%d\n",j);
      |   ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include<string.h>
  +++ |+#include <cstdio>
    3 | int main()
Language: C++

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

int main() {
  int n;
  string s;
  cin n >> s;
  char last = s[0];
  int ans = 1;
  for (int i = 1; i < n; ++i) {
  	if (s[i] != last) {
    	++ans;
    	last = s[i]; 
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'n'
    7 |   cin n >> s;
      |      ^~
      |      ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define max(a,b) ((a>b)?a:b);
#define min(a,b) ((b>a)?a:b);
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define forn(low,high,i) for(i=low;i<high;i++)
#define forrev(high,low,i) for(i = high; i>= low;i--)                                 //g++ atc2.cpp -o atc2.exe
#define zeroes(x) memset(x,0,sizeof(x))                                        //all elements to 0
#define all(x) (x).begin(), (x).end()
typedef long long int ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
const ll mod =1e9+7;
const ll maxn=100000;







bool sortbysec(const pair<int,int> &a,                         //sorting of elements wrt second
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 




int main()
{
	
long long int n,i,sum=0;
cin>>n;
char ch;
vector <char> v;

for( i=1;i<n;i++)
{
	
	
	cin>>ch;
	v.push_back(ch);
		if(ch[i]==ch[i-1])
			sum++;
		
	
}
cout<<n-sum;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:22: error: invalid types 'char[long long int]' for array subscript
   59 |                 if(ch[i]==ch[i-1])
      |                      ^
a.cc:59:29: error: invalid types 'char[long long int]' for array subscript
   59 |                 if(ch[i]==ch[i-1])
      |                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    long  long int N;cin>>N;
    string S;cin>>S;
    long long int size,ans;
    size=S.length();
    ans=N;
    for(int i=0;i<;i++){

            if(S[i]==S[i-1]){
                ans=(ans-1);
            }
        ans=ans;
    }
    cout<<ans;
    return 0;
}

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

＃いんｃぅ
int main(void)
{
	int sur[10000];
	int kaz = 0;
	int i = 0;
	int a = 0;
	int b = 1;

	scanf_s("%d", &kaz);
	for (i = 0; i < kaz; i++) {
		scanf_s("%c", &sur[i]);
	}

	for (a = 0; a < kaz - 1; a++) {
		if (sur[a] = sur[a + 1]) {}
		else {
			b = b + 1;
		}
	}

	printf("%d", b);
		return 0;
	}

Compiler output:
a.cc:1:1: error: '\U0000ff03\U00003044\U00003093\U0000ff43\U00003045' does not name a type
    1 | ＃いんｃぅ
      | ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  N = B;
  string A;
  for (int i = 0; i < (N - 1); i++) {
    if (A.at(i) == A.at(i + 1)) {
      B--;
    }
  }
  cout << B << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'B' was not declared in this scope
    6 |   N = B;
      |       ^
Language: C

#include<stdio.h>

int main(void) {

	long long int N, i=0, z=0, u = 0;
	char S[10000], answer[10000];

	scanf("%lld", &N);
for(i = 0;i < N; i++) {
	scanf("%c", &S[i]);
}
	i=0;
	while(i < N-1) {
		for(u = i;S[u]==S[i+1]||i < N;) {
		i++;
		}
		answer[z] = S[u];
	z++;
	}

	printf("%s", anwser);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:22: error: 'anwser' undeclared (first use in this function); did you mean 'answer'?
   21 |         printf("%s", anwser);
      |                      ^~~~~~
      |                      answer
main.c:21:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int N = B;
  string A;
  for (int i = 0; i < (N - 1); i++) {
    if (A.at(i) == A.at(i + 1)) {
      B--;
    }
  }
  cout << B << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: redeclaration of 'int N'
    6 |   int N = B;
      |       ^
a.cc:4:7: note: 'int N' previously declared here
    4 |   int N;
      |       ^
a.cc:6:11: error: 'B' was not declared in this scope
    6 |   int N = B;
      |           ^
Language: C++

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

int main() {
  int N;
  string S, color, next_color;
  cin >> N >> S;

 for(int i; i < N; i++){
   color = S.at(i);
   next_color = S.at(i+1)
   while(color == next_color){
     S.erase(i);
     N--;
   } 
 }

 cout << S.size();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected ';' before 'while'
   11 |    next_color = S.at(i+1)
      |                          ^
      |                          ;
   12 |    while(color == next_color){
      |    ~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'arr' was not declared in this scope
   15 |                 cin>>arr[i];
      |                      ^~~
Language: C++

#include <iostream>
#include <vector>
#include <set>
 
int main(){
  int N;
  std::cin >> N;
  std::vector<std::string> v;
  std::string s;
  std::cin >> s;
  v.push_back(s);
  std::set<std::string> set;
  std::vector<std::string> result;
  for (std::vector<std::string>::iterator it = v.begin(); it != v.end(); ++it)
  {
      if (set.insert(*it).second)
          result.push_back(*it);
  }
  std::cout << result.length() << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length'
   19 |   std::cout << result.length() << std::endl;
      |                       ^~~~~~
Language: C++

#include <iostream>
#include <vector>
 
int main(){
  int N;
  std::cin >> N;
  std::vector<std::string> v;
  std::string s;
  std::cin >> s;
  v.push_back(s);
  std::set<std::string> set;
  std::vector<std::string> result;
  for (std::vector<std::string>::iterator it = v.begin(); it != v.end(); ++it)
  {
      if (set.insert(*it).second)
          result.push_back(*it);
  }
  std::cout << result.length() << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'set' is not a member of 'std'
   11 |   std::set<std::string> set;
      |        ^~~
a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    2 | #include <vector>
  +++ |+#include <set>
    3 | 
a.cc:11:23: error: expected primary-expression before '>' token
   11 |   std::set<std::string> set;
      |                       ^
a.cc:11:25: error: 'set' was not declared in this scope
   11 |   std::set<std::string> set;
      |                         ^~~
a.cc:18:23: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length'
   18 |   std::cout << result.length() << std::endl;
      |                       ^~~~~~
Language: C++


#include <iostream>
#include <vector>

int main(){
  int N;
  std::cin >> N;
  std::vector<std::string> v;
  std::string s
  std::cin >> s;
  v.push_back(s);
  std::set<std::string> set;
  std::vector<std::string> result;
  for (std::vector<std::string>::iterator it = v.begin(); it != v.end(); ++it)
  {
      if (set.insert(*it).second)
          result.push_back(*it);
  }
  std::cout << result.length() << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'std'
   10 |   std::cin >> s;
      |   ^~~
a.cc:11:15: error: 's' was not declared in this scope
   11 |   v.push_back(s);
      |               ^
a.cc:12:8: error: 'set' is not a member of 'std'
   12 |   std::set<std::string> set;
      |        ^~~
a.cc:4:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    3 | #include <vector>
  +++ |+#include <set>
    4 | 
a.cc:12:23: error: expected primary-expression before '>' token
   12 |   std::set<std::string> set;
      |                       ^
a.cc:12:25: error: 'set' was not declared in this scope; did you mean 'tzset'?
   12 |   std::set<std::string> set;
      |                         ^~~
      |                         tzset
a.cc:19:23: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'length'
   19 |   std::cout << result.length() << std::endl;
      |                       ^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'int'
    5 |   int n, ans = 1;
      |   ^~~
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin>>n;
      |        ^
      |        yn
a.cc:7:8: error: 's' was not declared in this scope
    7 |   cin>>s;
      |        ^
a.cc:9:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |         if(s[i] != s[i - 1]) ans++;
      |                              ^~~
      |                              abs
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'int'
    5 |   int n, ans = 0;
      |   ^~~
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin>>n;
      |        ^
      |        yn
a.cc:7:3: error: 'a' was not declared in this scope
    7 |   a[0] = 0;
      |   ^
a.cc:10:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |         if(a[i] != a[i - 1]) ans++;
      |                              ^~~
      |                              abs
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<iostream>
int main(void){
  int sur[kaz];
  int i=0;
int a=0;
  int b=1;
  
  scanf("%d",&kaz);
  for(i=0;i<kaz,i++){
    scanf(%d,&sur[i]);
  }
  
  for(a=0;a<kaz-1;a++){
    if(sur[a]=sur[a+1])
      else{
      b=b+1;
      }
    
   return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:3:11: error: 'kaz' was not declared in this scope
    3 |   int sur[kaz];
      |           ^~~
a.cc:9:20: error: expected ';' before ')' token
    9 |   for(i=0;i<kaz,i++){
      |                    ^
      |                    ;
a.cc:10:11: error: expected primary-expression before '%' token
   10 |     scanf(%d,&sur[i]);
      |           ^
a.cc:10:12: error: 'd' was not declared in this scope
   10 |     scanf(%d,&sur[i]);
      |            ^
a.cc:10:15: error: 'sur' was not declared in this scope
   10 |     scanf(%d,&sur[i]);
      |               ^~~
a.cc:14:8: error: 'sur' was not declared in this scope
   14 |     if(sur[a]=sur[a+1])
      |        ^~~
a.cc:15:7: error: expected primary-expression before 'else'
   15 |       else{
      |       ^~~~
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:2:15: note: to match this '{'
    2 | int main(void){
      |               ^
Language: C++

#include <stdlib.h>
using namespace std;
int main()
{
    int N;
    cin >> N;
    string S;
    cin >> S;
    int ans = 1;
    for(int i = 0;i < N - 1;i++){
        if(S.at(i) != S.at(i + 1)){
            ans++;
        }
    }
  cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> N;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <stdlib.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string S;
      |     ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <stdlib.h>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:8:12: error: 'S' was not declared in this scope
    8 |     cin >> S;
      |            ^
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << ans;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'a' was not declared in this scope
    7 |   a[0] = 0;
      |   ^
Language: C++

#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int MAX = 1000000;
int main()
{
    int N;
    cin >> N;
    string S;
    cin >> S;
    sort(S.begin(),S.end());
    int ans = 1;
    for(int i = 0;i < N - 1;i++){
        if(S.at(i) != S.at(i + 1)){
            ans++;
        }
    }
  cout << ans;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: expected '}' at end of input
   19 |     return 0;
      |              ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

using namespace std;

int main()
{
int N , c=0, s=0;
cin >> N ;
string S;
S.size()==N;
cin >> S;
for(int i=0; i<N; i++)
{
    if(S[i]==S[i+1])
     s++;
      else
        c++;
}
cout <<c ;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin >> N ;
      | ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:7:1: error: 'string' was not declared in this scope
    7 | string S;
      | ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:8:1: error: 'S' was not declared in this scope
    8 | S.size()==N;
      | ^
a.cc:17:1: error: 'cout' was not declared in this scope
   17 | cout <<c ;
      | ^~~~
a.cc:17:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<stdio.h> 
int main()
{
	long long n,i,j;
	 while(~scanf("%lld\n",&n))
	{
	 char a[n];
     gets(a);
	int k;
	for(k=i=0;i<n-1;i++)
	 {
	 	if(a[k]==a[i+1])
	 	   a[i+1]='0';
	 	else
	 	{
	 		k=i+1;
	 	}
	 	
	 }
	 int h=0;
	 for(i=0;i<=n-1;i++)
	  {
	  	if(a[i]!='0')
	  	h=h+1;
	  }
	  printf("%d\n",h);
    }
	  return 0;
}

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

#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  string s;
  cin >> s;
  vector<char> stack;
  for(int i = 0; i < n; ++i) {
    if(stack.size() == 0) {
      stack.push_back(s[i]);
      continue;
    }
    if(stack.back() == s[i]) {
      continue;
    }
    cout << stack.size() << endl;
    return 0;
  }

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

#include <iostream>
using namespace std;
int main() {
    int n;
    string s;
    std::cin >> n;
    std::cin >> str;
  
    int ans = 0;
    std::string temp = str.substr(0, 1);
    
    for(int i=0; i<n; i++) {
	    if (temp != str.substr(i, 1)){
        	ans += 1;
            temp = str.substr(i, 1);
        }
    }
  
    cout << ans << endl;
}

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

#include <iostream>
using namespace std;
int main() {
    int n;
    string s;
    std::cin >> n;
    std::cin >> s;
  
    int ans = 0;
    std::string temp = str.substr(0, 1);
    
    for(int i=0; i<n; i++) {
	    if (temp != str.substr(i, 1)){
        	ans += 1;
            temp = str.substr(i, 1);
        }
    }
  
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |     std::string temp = str.substr(0, 1);
      |                        ^~~
      |                        std
Language: C++

#include<stdio.h>
int main(){
int N;
  scanf("%d",&N);
  char S[N];
  int a1,a2,i;
  a1=N;
  for(i=1<;i<=N;++i){
scanf("%s",&S[i]);
  }
  for(i=2;i<=N;++i){
      if(S[i]==S[i-1]){
        a2=a1-1;
        a1=a2;
      }
    }
  printf("%ld\n",a1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before ';' token
    8 |   for(i=1<;i<=N;++i){
      |           ^
Language: C

#include <stdio.h>
int main(void)
{
  int N = 0;
  scanf("%d", &N);

  char s[10001];
  scanf("%s", s);
  
  int ans = 1;
  for(int i = 1; i < N; ji ++){ 
     if(s[i] != s[i-1]){ 
        ans ++;
    }
  }
  printf("%d",ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:25: error: 'ji' undeclared (first use in this function); did you mean 'i'?
   11 |   for(int i = 1; i < N; ji ++){
      |                         ^~
      |                         i
main.c:11:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<stdio.h>
int main(){
int N;
  scanf("%ld",&N);
  char S[N];
  int a1,a2,i;
  a1=N;
  for(i=1<;i<=N;++i){
scanf("%s",&S[i]);
    if(i>=2){
      if(S[i]=S[i-1]){
        a2=a1-1;
        a1=a2;
      }
    }
  }
  printf("%ld\n",a1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before ';' token
    8 |   for(i=1<;i<=N;++i){
      |           ^
Language: C++

#include<stdio.h> 
int main()
{
	int n,i,j;
	 while(~scanf("%d\n",&n))
	{
	 char a[n];
     gets(a);
	int k;
	for(k=i=0;i<n-1;i++)
	 {
	 	if(a[k]==a[i+1])
	 	   a[i+1]='0';
	 	else
	 	{
	 		k=i+1;
	 	}
	 	
	 }
	 for(i=0;i<=n-1;i++)
	  {
	  	if(a[i]!='0')
	  	printf("%c",a[i]);
	  	if(i==n-1)
	  	printf("\n");
	  }
    }
	  return 0;
}

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

#include<stdio.h>
int main(){
int N;
  scanf("%ld",&N);
  char S[N];
  int a1,a2,i;
  a1=N;
  for(i=1<;i<=N;++i){
scanf("%s",&S[i]);
    if(i>=2){
      if(S[i]=s[i-1]){
        a2=a1-1;
        a1=a2;
      }
    }
  }
  printf("%ld\n",a1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before ';' token
    8 |   for(i=1<;i<=N;++i){
      |           ^
a.cc:11:15: error: 's' was not declared in this scope
   11 |       if(S[i]=s[i-1]){
      |               ^
Language: C++

#include<stdio.h>
int main(){
int N;
  scanf("%ld",&N);
  char S[N];
  int a1,a2;
  a1=N;
  for(i=1<;i<=N;++i){
scanf("%ld",&S[i]);
    if(i>=2){
      if(S[i]=s[i-1]){
        a2=a1-1;
        a1=a2;
      }
    }
  }
  printf("%ld\n",a1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=1<;i<=N;++i){
      |       ^
a.cc:8:11: error: expected primary-expression before ';' token
    8 |   for(i=1<;i<=N;++i){
      |           ^
a.cc:11:15: error: 's' was not declared in this scope
   11 |       if(S[i]=s[i-1]){
      |               ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(void){
  int N;
  cin >> N;
  char s[N];
  char str;
  cin >> str;
  s[] = str;
  
  int point=1;
  int i;
  for(i=0;i<N-1;i++){
    if(s[i]!=s[i+1]) point++; 
  }
  printf("%d",point);
  
  
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected primary-expression before ']' token
   11 |   s[] = str;
      |     ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(void){
  int N;
  cin >> N;
  string s[N];
  string str;
  cin >> str;
  s[] = str;
  
  int point=1;
  int i;
  for(i=0;i<N-1;i++){
    if(s[i]!=s[i+1]) point++; 
  }
  printf("%d",point);
  
  
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected primary-expression before ']' token
   11 |   s[] = str;
      |     ^
Language: C++

#include <iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string s;
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/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:8:10: error: 's' was not declared in this scope
    8 |   cin >> s;
      |          ^
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   cout << count;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  int total = N;
  for (int i = 0; i < N; ++i) cin >> S[i];
  int total = N;
  for (int j = 0; j < N - 1; ++j) {
    
    if (S[j] == S[j + 1]) { 
      total -= 1;
    }
  }
  cout << total << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: redeclaration of 'int total'
    9 |   int total = N;
      |       ^~~~~
a.cc:7:7: note: 'int total' previously declared here
    7 |   int total = N;
      |       ^~~~~
Language: C++

#include <stdio.h>
#include <string.h>
int main()
{
    int n,i,t=0;
    scanf("%d",&n);
    getchar();
    char s[n];
    gets(s);
    for(i=0;i<n;i++){
        if(s[i+1]!=s[i]){
            t+=1;
        }
    }
    printf("%d",t);
}


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

#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(void){
  int N;
  cin >> N;
  char s[N];
  gets(s);
  //cin >> s[N];
  int point=1;
  int i;
  for(i=0;i<N-1;i++){
    if(s[i]!=s[i+1]) point++; 
  }
  printf("%d",point);
  
  
 return 0;
}

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

#include<cstdio>
#include<cstring>
int main(){
	int a,b,c,d,i,j;
	char n[10005];
	while(~scanf("%d",&a))
	{
		c=1;
	
		gets(n);
		b=strlen(n);
		for(i=0;i<b-1;i++)
		if(n[i]!=n[i+1])
		c+=1;
		printf("%d\n",c);
	}		
}

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

#include <iostream>
using namespace std;
int main()
  char s[1000000];
{int n;

cin >>n;
cin>>s;
int t=0;
int sum=1;
{for (int j=0;j<n-1;j++)
  {if (s[j]==s[j+1])t++;}
 if (t==n-1)cout <<1;
 else 
  {int i=0;
   while (i<n-1)
  {while (s[i]==s[i+1]and i<n-1)
  {i++;}
  sum++;i++;
  }
   cout <<sum;
  }



}

}

Compiler output:
a.cc:4:3: error: expected initializer before 'char'
    4 |   char s[1000000];
      |   ^~~~
a.cc:5:1: error: expected unqualified-id before '{' token
    5 | {int n;
      | ^
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<queue>
#include<cstring>
#define INF 0x3f3f3f3f
#define mod 1000000007
using namespace std;
char b[100005];
int main()
{
	
	int n,sum=1;
	char a;
	scanf("%d",&n);
	getchar();
	gets(b);
    for(int i=1;i<n;i++)
    {
    	
			if(b[i]!=b[i-1])
			sum++;
	}
	
	printf("%d\n",sum);
 } 

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

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

int main()
{
  int n,i,c=0;
  scanf("%d",&n);
  char str[n];
  
  scanf("%s",str);
  for(i=0;i<n-1;i++)
  {
    if(str[i]!=str[i+1]
       c++;
   }  
  printf("%d\n",c);
  return 0;
}     
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before 'c'
   13 |     if(str[i]!=str[i+1]
      |                        ^
      |                        ;
   14 |        c++;
      |        ~                
a.cc:15:4: error: expected primary-expression before '}' token
   15 |    }
      |    ^
a.cc:14:12: error: expected ')' before '}' token
   14 |        c++;
      |            ^
      |            )
   15 |    }
      |    ~        
a.cc:13:7: note: to match this '('
   13 |     if(str[i]!=str[i+1]
      |       ^
a.cc:15:4: error: expected primary-expression before '}' token
   15 |    }
      |    ^
Language: C++

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

int main()
{
  int n,i,c=0;
  scanf("%d",&n);
  char str[n];
  
  scanf("%s",str);
  for(i=0;i<n-1;i++)
  {
    if(str[i]!=str[i+1]
       c++;
   }  
  printf("%d\n",c);
  return 0;
}     
    
  

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #incude; did you mean #include?
    2 | #incude<string.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before 'c'
   13 |     if(str[i]!=str[i+1]
      |                        ^
      |                        ;
   14 |        c++;
      |        ~                
a.cc:15:4: error: expected primary-expression before '}' token
   15 |    }
      |    ^
a.cc:14:12: error: expected ')' before '}' token
   14 |        c++;
      |            ^
      |            )
   15 |    }
      |    ~        
a.cc:13:7: note: to match this '('
   13 |     if(str[i]!=str[i+1]
      |       ^
a.cc:15:4: error: expected primary-expression before '}' token
   15 |    }
      |    ^
Language: C++

#include<stdio.h>
int main()
{
	long n,i,cnt=0;
	char a[100010]={};
	while(~scanf("%ld",&n)){
		getchar();
		gets(a);
		for(i=0;i<n;i++){
			while(a[i]==a[i+1]){
				i++;
			}cnt++;
		}printf("%ld\n",cnt);
		cnt=0;
	}
}

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

    #incluse<iostream>
    using namespace std;
    int main(){
      int n,i;
      cin>>n;
      char s[n];
      for(i=0;i<n;i++){
        cin>>s[i];
      }
      cout<<s[0];
      for(i=1;i<n;i++){
        if(s[i]!=s[i-1])
          cout<<s[i];
      }
      cout<<"\n";
      return 0;
    }

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

#include<bits/stdc++.h>
using namespace std;
signed main(){
int n;
int count=0;
string a;
char b={};
cin>>n;
cin>>a;
b=a[0];
for(int i=0;i<n;i++){
if(a[i]==b){
}else{
c​a[i];
}
}
cout<<count+1<<"\n";
return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: 'c\U0000200ba' was not declared in this scope
   14 | c​a[i];
      | ^~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		char[] s = sc.next().toCharArray();

		List<Character> list = new ArrayList<Character>();
		for (int i = 0; i < n; i++) {
			if (list.size() == 0) {
				list.add(s[i]);
				continue;
			}
			if (list.get(list.size() - 1).equals(s[i])) {
				continue;
			}
			list.add(s[i]);
		}
		System.out.println(list.size());
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
1 error