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

fun main(args: Array<String>) {
    abc143b()
}

fun abc143b() {
    val n = readLine()!!.toInt()
    val dList = readLine()!!.split(" ").map { it.toInt() }

    val answer = (0 until n).map { i ->
        (i + 1 until n).map { j ->
            dList[i] * dList[j]
        }
    }.flatten().sum()

    println(answer)
}


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
fun main(args: Array<String>) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
fun main(args: Array<String>) {
             ^
Main.java:1: error: class, interface, enum, or record expected
fun main(args: Array<String>) {
                    ^
3 errors
Language: Java

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

public class B {
	public static void main(String[] args) throws IOException {
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		
		int n = sc.nextInt();
		int[] array = new int[n];
		for(int i = 0; i < n; i++)
			array[i] = sc.nextInt();
		
		long sum = 0;
		for(int i = 0; i < n; i++) {
			for(int j = i + 1; j < n; j++) {
				sum += array[i] * array[j];
			}
		}
		
		System.out.println(sum);
	}
}


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

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

int main() {
  cin >> N >> S;
  S.push_back('#');
  int ans = 0;
  for(int i = 0; i + 1 < S.size(); i++) {
      // 数えるのは境界線の数だけでいい
      if(S[i] != S[i+1]) ans++;
  }
  cout << ans << endl;
  return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N >> S;
      |          ^
a.cc:6:15: error: 'S' was not declared in this scope
    6 |   cin >> N >> S;
      |               ^
a.cc:14:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   14 |   return;
      |   ^~~~~~
Language: C++

// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 09/11/20 07:34:58
// -----------------------------------

#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);

  int n; cin>>n;
  string s ;cin>>s;
  int ans = 0;
  int p = '\0';
  for (int i = 0; i < n; i++) {
    if (p != s[i]) {
      ans++;
    }
    p = s[i];
  }
  ++ans;
  cout << ans << endl;

  return 0;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'pop_back' was not declared in this scope
   10 |       pop_back=S.at(i);
      |       ^~~~~~~~
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
      	String s = scn.next();
		String[] list = s.split("");
      	int count = 0;
		for(int i=0; i<n; i++){
			if(list[i].equals(a[i-1])) count++;
		}
      	System.out.println(n-count);
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
			if(list[i].equals(a[i-1])) count++;
			                  ^
  symbol:   variable a
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int N;
string s;

void solve()
{
  cin >> N >> s;
  int count=0;
  s.push_back("#");
  for(int i=0; i+1 < s.size(); i++)
  {
    if(s[i] != s[i+1])
      count++;
  }
  cout << count << endl;
}
  
int main()
{
  solve();
  return 0;
}
  
        
        

Compiler output:
a.cc: In function 'void solve()':
a.cc:12:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |   s.push_back("#");
      |               ^~~
      |               |
      |               const char*
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:1572:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1572 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>

int N;
string S;

void solve() {
    //cout.precision(10);
    cin >> N >> S;
    S.push_back('#');
    int ans = 0;
    for(int i = 0; i + 1 < S.size(); i++) {
        if(S[i] != S[i+1]) ans++;
    }
    cout << ans << endl;
    return;
}

int main() {
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:13:14: error: missing template arguments before '>>' token
   13 |     cin >> N >> S;
      |              ^~
Language: C++

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

int N;
string S;
int main (){
	cin >> N >>S;
	int ans = 0;
	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:10:34: error: 's' was not declared in this scope
   10 |         for(int i=0;i<N-1;i++)if(s[i] != s[i+1]) ans++;
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define INF (1e18+1)
#define LL long long
#define rep(i, c) for(int i = 0; i < (int)c; +++i)
//ios_base::sync_with_stdio(0);cin.tie(0);

using namespace std;

int main()
{
    
    int N;
string S;
 cin >> N >> S;
    S.push_back('#');
    int ans = 0;
    for(int i = 0; i + 1 < S.size(); i++) {
        if(S[i] != S[i+1]) ans++;
    }
    cout << ans << endl;
    return;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   21 |     return;
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define INF (1e18+1)
#define LL long long
#define rep(i, c) for(int i = 0; i < (int)c; +++i)
//ios_base::sync_with_stdio(0);cin.tie(0);

using namespace std;

int main()
{
 cin >> N >> S;
    S.push_back('#');
    int ans = 0;
    for(int i = 0; i + 1 < S.size(); i++) {
        if(S[i] != S[i+1]) ans++;
    }
    cout << ans << endl;
    return;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'N' was not declared in this scope
   11 |  cin >> N >> S;
      |         ^
a.cc:11:14: error: 'S' was not declared in this scope
   11 |  cin >> N >> S;
      |              ^
a.cc:18:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   18 |     return;
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define INF (1e18+1)
#define LL long long
#define rep(i, c) for(int i = 0; i < (int)c; +++i)
//ios_base::sync_with_stdio(0);cin.tie(0);

using namespace std;

int main()
{


    string s;
    getline(cin,s);
    int ctn = 0;

    for(auto i = 1; i < s.length() ; ++i)
    {
        if(s[i+1] != s[i])
        {
//            cerr<<s[i-1]<<s[i]<<endl;
            ++ctn;;
        }
    }
//    for (auto i : v) cerr<<i;
//
//    cerr<<endl;

    cout<<v.size();


}

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

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

#define ALL(a)  (a).begin(),(a).end()

int main(){
  int N; cin >> N;
  string S; cin >> S;
  S.erase(unique(ALL(vals)), vals.end());
  
  cout << S.size() << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'vals' was not declared in this scope
    9 |   S.erase(unique(ALL(vals)), vals.end());
      |                      ^~~~
a.cc:4:18: note: in definition of macro 'ALL'
    4 | #define ALL(a)  (a).begin(),(a).end()
      |                  ^
Language: Java

mport java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        char[] ch = new char[n];
        for(int i=0; i<n; i++) {
            ch[i] = s.charAt(i);
        }
        int count = 1;
        for(int i=0; i<n-1; i++) {
            if(ch[i] != ch[i+1]) {
                count++;
            }
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: C++

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

signed main() {
	ll n;
	string s;
	cin >> n >> s;
	s.pushback('#');
	ll ans = 0;
	for(ll i = 0; i+1 < s.size(); i++){
		if(s[i] != s[i + 1]) ++ans;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pushback'; did you mean 'push_back'?
   10 |         s.pushback('#');
      |           ^~~~~~~~
      |           push_back
Language: C++

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

signed main() {
	ll n ans;
	string s;
	cin >> n >> s;
	rep(i, n -1){
		if(s[i] == s[i + 1]) ++ans;
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected initializer before 'ans'
    7 |         ll n ans;
      |              ^~~
a.cc:9:16: error: 'n' was not declared in this scope
    9 |         cin >> n >> s;
      |                ^
a.cc:11:40: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |                 if(s[i] == s[i + 1]) ++ans;
      |                                        ^~~
      |                                        abs
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: Java

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main143 {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);


		int n = Integer.parseInt(scanner.nextLine());

		char[] temp = scanner.nextLine().toCharArray();
		List<Character> list = new LinkedList<Character>();

		for(char value : temp) {

			list.add(value);

		}

		for(int i = 0; i < n; i++) {
			while(i < n - 1 && list.get(i) == list.get(i + 1)) {

				list.remove(i + 1);
				n--;
			}
		}
		System.out.println(list.size());
	}
}


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

#include<iostream>
using namespace std;

int main()
{
  int n;
  cin >> n;
  
  char c = '';
  int redisue = 0;
  for (int i = 0; i < n; i ++)
  {
    char tmp;
    cin >> tmp;
    if (c != tmp)
    {
      c = tmp;
      redisue ++;
    }
  }
  
  cout << redisue;
  return 0;
}

Compiler output:
a.cc:9:12: error: empty character constant
    9 |   char c = '';
      |            ^~
Language: C

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main () {
    int n;
    string s; cin >> n >> s;
    char now_c;
    int count = 1; 

    for (int i = 0; i < n; i++) {
        char c = s[i];
        if (i == 0) {
            now_c = c;
        } else {
            if (now_c == c) {
                continue;
            } else {
                count++;
                now_c = c;
            }
        }
    }

    cout << count << endl;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: conflicting declaration 'std::string s'
    8 |   string s;
      |          ^
a.cc:6:7: note: previous declaration as 'int s'
    6 |   int s=1;
      |       ^
a.cc:11:9: error: invalid types 'int[int]' for array subscript
   11 |     if(s[i]!=s[i+1]){
      |         ^
a.cc:11:15: error: invalid types 'int[int]' for array subscript
   11 |     if(s[i]!=s[i+1]){
      |               ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected '}' at end of input
   13 |   cout << ans << endl;
      |                       ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

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

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

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

#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const int INF = 1e9;
const int EPS = 1e-9; 

int main() {
  int N;
  string S;
  cin >> N >> S;
  string OL_S;
  
  OL_S.push_back(S.at(0));
  for (int i = 1; i < N; ++i) {
    if(S.at(i) != S.at(i-1)) OL_S.push_back(S.at(i)); 
  }
  cout << OL_S.size() << endl; << OL_S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: expected primary-expression before '<<' token
   17 |   cout << OL_S.size() << endl; << OL_S << endl;
      |                                ^~
Language: C++

#include <iostream>

using namespace std;

int main(){
	int n;
    string s;
    cin >> n >> s;
    string res = s[0];
    for(int i = 1; i < n; i++){
    	if(s[i] == res.back())continue;
        else res += s[i];
    }
  cout << res.size() << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |     string res = s[0];
      |                     ^
Language: C++

#include <iostream>

using namespace std;

int main(){
	int n, s;
    cin >> n >> s;
    string res = s[0];
    for(int i = 1; i < n; i++){
    	if(s[i] == res.back())continue;
        else res += s[i];
    }
  cout << res.size() << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: invalid types 'int[int]' for array subscript
    8 |     string res = s[0];
      |                   ^
a.cc:10:13: error: invalid types 'int[int]' for array subscript
   10 |         if(s[i] == res.back())continue;
      |             ^
a.cc:11:22: error: invalid types 'int[int]' for array subscript
   11 |         else res += s[i];
      |                      ^
Language: C++

#include <iostream>

using namespace std;

int main(){
	int n, s;
    cin >> n >> s;
    string res = s[0];
    for(int i = 1; i < n; i++){
    	if(s[i] == res.back())continue;
        else res += s[i];
    }
  cout << res.size() << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: invalid types 'int[int]' for array subscript
    8 |     string res = s[0];
      |                   ^
a.cc:10:13: error: invalid types 'int[int]' for array subscript
   10 |         if(s[i] == res.back())continue;
      |             ^
a.cc:11:22: error: invalid types 'int[int]' for array subscript
   11 |         else res += s[i];
      |                      ^
Language: C++

#include<string>
#include<iostream>

using namespace std;

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

Compiler output:
a.cc:23:3: error: expected unqualified-id before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
  int num,i,b;
  b=1;
  scanf("%d",&num);
  char a[num];
scanf("%numd",a);

  for(i=0;i<n-1;++i)
  {
  if(a[i]!=a[i+1]) b++;
  }
  
  printf("%d",b);
  
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:13: error: 'n' undeclared (first use in this function)
   10 |   for(i=0;i<n-1;++i)
      |             ^
main.c:10:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
  int num,i,b;
  b=1;
  scanf("%d",&num);
  char a[n];
scanf("%numd",a);

  for(i=0;i<n-1;++i)
  {
  if(a[i]!=a[i+1]) b++;
  }
  
  printf("%d",b);
  
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:10: error: 'n' undeclared (first use in this function)
    7 |   char a[n];
      |          ^
main.c:7:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
  int num,i,b;
  b=1;
  scanf("%d",&n);
  char a[n];
scanf("%numd",a);

  for(i=0;i<n-1;++i)
  {
  if(a[i]!=a[i+1]) b++;
  }
  
  printf("%d",b);
  
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:15: error: 'n' undeclared (first use in this function)
    6 |   scanf("%d",&n);
      |               ^
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#includee<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  char s[n];
  scanf("%s",&s);
  int sum=0;
  for(int i=0;i<n;i++){
    if(s[i]!=s[i+1]){
      sum++;
    }
  }
  printf("%d\n",sum+1);
  return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includee; did you mean #include?
    1 | #includee<stdio.h>
      |  ^~~~~~~~
      |  include
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includee<stdio.h>
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   printf("%d\n",sum+1);
      |   ^~~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: expected ')' before ';' token
   17 |                 sol++;
      |                      ^
      |                      )
a.cc:16:20: note: to match this '('
   16 |                 if (s[i] != s[i-1];
      |                    ^
Language: Java

import java.util.Scanner;

public class ABC143C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        char[] S = sc.next().toCharArray();
        char preS = '.';
        int r = 0;
        for (char s:
             S) {
            if (preS!=s) r++;
            preS = s;
        }
        System.out.println(r);
    }
}

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

import java.util.Scanner;

public class ABC143C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        char[] S = sc.next().toCharArray();
        char preS = '.';
        int r = 0;
        for (char s:
             S) {
            if (preS!=s) r++; 
            preS = s;
        }
        System.out.println(r);
    }
}

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

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


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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  cin >> n >> s;
  int count=n;
  for(i=0;i<n-1;i++){
    if(s.at(i)==s.at(j)){
      count--;
    }
  }
  cout << count;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<n-1;i++){
      |       ^
a.cc:9:22: error: 'j' was not declared in this scope
    9 |     if(s.at(i)==s.at(j)){
      |                      ^
Language: Java

import java.util.Scanner;
public class MainC{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String S = sc.next();  
    StringBuilder s = new StringBuilder();
    s.append(S.charAt(0)); 
    for(int i=1;i<S.length();i++){
      char tmp = S.charAt(i);
        if(S.charAt(i-1)!=tmp){
            s.append(tmp);
        }
    }
    System.out.print(s.length());
    return;
  }
}



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

#include<iostream>
#include<string>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }
int main() {
  char prev = ' ';
  int N, ans = 0; std::string S; std::cin >> N >> S;
  for(int i = 0; i < N; ++i) {
    if(S[i] != prev) { ++ans; prev = S[i]; }
  }
  fin(ans);
  return 0;
}
~   

Compiler output:
a.cc:15:2: error: expected class-name at end of input
   15 | ~
      |  ^
Language: C++

#include <stdio.h>
#include <string.h>
int main ()
{
	long long N,i,j,l;
	char S[1000000],a[1000000];
	scanf("%lld %s",&N,&S);
	
	for(i=1,j=1;s[j]!='\0';j++)
	{
		a[0]=S[0];
		if(a[i-1]==S[j])
		{
			continue;
		}
		else
		{
			a[i]=S[j];
			i++;
		}
		
	}
	l=strlen(a);
	printf("%lld\n",l);
	
	for(i=0;i<l;i++)
	{
		a[i]='\0';
	}
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 's' was not declared in this scope
    9 |         for(i=1,j=1;s[j]!='\0';j++)
      |                     ^
Language: C++

#include <bits/stdc++.h>

#define int long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  int y=n;
  string s;
  cin >> s;
  char x='#';
  for(int i=0;i<n;i++) {
    if(x==s.at(i)) {
      y-=1;}
    else {
      y-=0;}
    x=s.at(i);}
  cout << y << endl;
  return 0;
  }
    


Compiler output:
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:5:1: note: in expansion of macro 'int'
    5 | int main() {
      | ^~~
a.cc:5:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:6:3: note: in expansion of macro 'int'
    6 |   int n;
      |   ^~~
a.cc:6:7: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   int n;
      |       ^
      |       yn
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:8:3: note: in expansion of macro 'int'
    8 |   int y=n;
      |   ^~~
a.cc:8:7: error: 'y' was not declared in this scope; did you mean 'yn'?
    8 |   int y=n;
      |       ^
      |       yn
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:12:7: note: in expansion of macro 'int'
   12 |   for(int i=0;i<n;i++) {
      |       ^~~
a.cc:12:11: error: 'i' was not declared in this scope
   12 |   for(int i=0;i<n;i++) {
      |           ^
a.cc:12:18: error: expected ')' before ';' token
   12 |   for(int i=0;i<n;i++) {
      |      ~           ^
      |                  )
a.cc:12:19: error: 'i' was not declared in this scope
   12 |   for(int i=0;i<n;i++) {
      |                   ^
Language: C++

#include <bits/stdc++.h>

#define int long long
using namespace std;
int main() {
  int n;
  cin >> n;
  int y=n;
  string s;
  cin >> s;
  char x='#';
  for(int i=0;i<n;i++) {
    if(x==s.at(i)) {
      y-=1;}
    else {
      y-=0;}
    x=s.at(i);}
  cout << y << endl;
  return 0;
  }
    

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main(){
  int n,s;
  cin>>n>>s;
  int n=s.size();
  rep(i,n-1){
    if(s.at(i)==s.at(i+1))n--;
  }
  cout<<n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: redeclaration of 'int n'
    9 |   int n=s.size();
      |       ^
a.cc:7:7: note: 'int n' previously declared here
    7 |   int n,s;
      |       ^
a.cc:9:11: error: request for member 'size' in 's', which is of non-class type 'int'
    9 |   int n=s.size();
      |           ^~~~
a.cc:11:10: error: request for member 'at' in 's', which is of non-class type 'int'
   11 |     if(s.at(i)==s.at(i+1))n--;
      |          ^~
a.cc:11:19: error: request for member 'at' in 's', which is of non-class type 'int'
   11 |     if(s.at(i)==s.at(i+1))n--;
      |                   ^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

char upper(char c){
	return c-0x20;
}

char lower(char c){
	return c+0x20;
}

void unique_vector(vector<int>& v){
	sort(all(v));
	v.erase(unique(all(v)), v.end());
}

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

//ユークリッドの互除法
//最大公約数
ll gcd(ll x, ll y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}

//最小公倍数
ll lcm(ll x, ll y){
	ll g = gcd(x,y);
	return x/g*y;
}

ll myPow(ll x, ll n, ll m){
  if(n == 0)
    return 1;
  if(n % 2 == 0)
    return myPow(x * x % m, n / 2, m);
  else
    return x * myPow(x, n - 1, m) % m;
}

//素因数分解
map<ll, ll> prime_factor(ll n)
{
	map<ll, ll> ret;
	for (ll i = 2; i * i <= n; i++)
	{
		while (n % i == 0)
		{
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1)
		ret[n] = 1;
	return ret;
}

int main() {
	int n;cin>>n;
	string s;cin>>s;
	int ans = 0;
	char c;
	rep(i,s.length){
		if(i==0){
			ans = 1;
			c = s[i];
			continue;
		}
		if(c==s[i])
			return;
		c = s[i];
		ans++;
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:88:17: 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 '()' ?)
   88 |         rep(i,s.length){
      |                 ^
a.cc:2:39: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i = 0; i < (n); ++i)
      |                                       ^
a.cc:95:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
   95 |                         return;
      |                         ^~~~~~
Language: C++

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

  cout<<count +1 <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before '}' token
   12 |     count++
      |            ^
      |            ;
   13 |   }
      |   ~
Language: Java

import java.util.Scanner;
class Main{
public static void main(String[] args){
  Scanner sc = new Scanner(Sytem.in);
  int n = sc.nextInt();
  int[] in = new int[n];
  String input = sc.next();
  int cnt = 0;
  for(int i = 0; i < n; i++){
    in[i] = input.charAt(i);
    if(i == 0){
      cnt++;
    }else{
      if(in[i] != in[i - 1]){
        cnt++;
      }
    }
  }
  System.out.println(cnt);
}
}

Compiler output:
Main.java:4: error: cannot find symbol
  Scanner sc = new Scanner(Sytem.in);
                           ^
  symbol:   variable Sytem
  location: class Main
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner();
    int n = new sc.nextInt();
    int[] x = new int[n];
    int[] y = new int[n];
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
      y[i] = sc.nextInt();
    }
    long sum = 0;
    for(int i = 0; i < n; i++){
      for(int j = i + 1; i < n; j++){
        sum += Math.sqrt(1.0 * (x[j] - x[i]) * (x[j] - x[i]) + (y[j] - y[i]) * (y[j] - y[i]));
      }
    }
    System.out.println(sum * 2 / n);
  }
}

Compiler output:
Main.java:4: error: no suitable constructor found for Scanner(no arguments)
    Scanner sc = new Scanner();
                 ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
Main.java:5: error: package sc does not exist
    int n = new sc.nextInt();
                  ^
2 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    9 |     if(str.at[i]==str.at[i+1]){
      |              ^
a.cc:9:25: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    9 |     if(str.at[i]==str.at[i+1]){
      |                         ^
Language: C++

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

int main(){
  int N;
  string S;
  cin>>N>>s;
  for(int i=0;i<S.size()-1;i++){
    if(S.at(i)==S.at(i+1)){
      N--;
    }
  }
  cout<<N<<endl;
}

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

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}
func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}
func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

//var done []bool = make([]bool, 10)
//var memo []int = make([]int, 10)

//func fib(n int) int {
//	fmt.Println(n)
//	if n == 0 {
//		return 0
//	}
//	if n == 1 {
//		return 1
//	}
//	if done[n] {
//		fmt.Println("done" + fmt.Sprint(n))
//		return memo[n]
//	}
//	done[n] = true
//	memo[n] = fib(n-1) + fib(n-2)
//	return memo[n]
//}

var m map[string]int = make(map[string]int)
var mInt map[int]int = make(map[int]int)

//var dp []int = make([]int, n)

//func fib(n int) int {
//	dp[0] = 0
//	dp[1] = 1
//	for i := 2; i <= n; i++ {
//		dp[i] = dp[i-1] + dp[i-2]
//	}
//	return dp[n]
//}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	s := next()
	var result int = 1
	for i := 0; i < n-1; i++ {
		if s[i] == s[i+1] {
			continue
		}
		result++
	}

	fmt.Println(result)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:16:1: error: 'func' does not name a type
   16 | func nextInt() int {
      | ^~~~
a.cc:20:1: error: 'func' does not name a type
   20 | func nextInts(n int) []int {
      | ^~~~
a.cc:48:1: error: 'var' does not name a type
   48 | var m map[string]int = make(map[string]int)
      | ^~~
Language: C++

#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1


 
void solve() {
  
int N;
string S;
    cin >> N >> S;
    S.erase(unique(S.begin(), S.end()), S.end());
    cout << S.size() << endl;
    return;
}
int main() {
    solve();
    return 0;
}


Compiler output:
a.cc:26:1: error: expected '}' before 'void'
   26 | void solve() {
      | ^~~~
a.cc:22:16: note: to match this '{'
   22 | const ll dx[4]={0,-1,0,1
      |                ^
a.cc:26:1: error: expected ',' or ';' before 'void'
   26 | void solve() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:36:5: error: 'solve' was not declared in this scope
   36 |     solve();
      |     ^~~~~
Language: C++

#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1


int N;
string S;
 
void solve() {
    cin >> N >> S;
    S.erase(unique(S.begin(), S.end()), S.end());
    cout << S.size() << endl;
    return;
}
int main() {
    solve();
    return 0;
}

Compiler output:
a.cc:25:1: error: expected '}' before 'int'
   25 | int N;
      | ^~~
a.cc:22:16: note: to match this '{'
   22 | const ll dx[4]={0,-1,0,1
      |                ^
a.cc:25:1: error: expected ',' or ';' before 'int'
   25 | int N;
      | ^~~
a.cc: In function 'void solve()':
a.cc:29:12: error: 'N' was not declared in this scope
   29 |     cin >> N >> S;
      |            ^
Language: C++

// Example program
#include <iostream>
#include <string>

int Number_Of_Smiles(char *inputString, int Len);

int main()
{
    char smiles[21] = {'x', 'x', 'z', 'a', 'f', 'f', 'e', 'e', 'e', 'e', 'd', 'd', 'f', 'k', 'k', 'k', 'k', 'l', 'l', 'q'};
    int Len = 20;
    std::cout << Number_Of_Smiles(smiles, Len);
    char smiles[11] = {'a', 'a', 'b', 'b', 'b', 'b', 'a', 'a', 'c', 'a', '\0'};
    int Len = 10;
    std::cout << Number_Of_Smiles(smiles, Len);
}

int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: conflicting declaration 'char smiles [11]'
   12 |     char smiles[11] = {'a', 'a', 'b', 'b', 'b', 'b', 'a', 'a', 'c', 'a', '\0'};
      |          ^~~~~~
a.cc:9:10: note: previous declaration as 'char smiles [21]'
    9 |     char smiles[21] = {'x', 'x', 'z', 'a', 'f', 'f', 'e', 'e', 'e', 'e', 'd', 'd', 'f', 'k', 'k', 'k', 'k', 'l', 'l', 'q'};
      |          ^~~~~~
a.cc:13:9: error: redeclaration of 'int Len'
   13 |     int Len = 10;
      |         ^~~
a.cc:10:9: note: 'int Len' previously declared here
   10 |     int Len = 20;
      |         ^~~
Language: C++

// Example program
#include <iostream>
#include <string>

int Number_Of_Smiles(char *inputString, int Len);

int main()
{
    char smiles[21] = {'x', 'x', 'z', 'a', 'f', 'f', 'e', 'e', 'e', 'e', 'd', 'd', 'f', 'k', 'k', 'k', 'k', 'l', 'l', 'q'};
    int Len = 20;
    std::cout << Number_Of_Smiles(smiles, Len);
    char smiles[21] = {'a', 'a', 'b', 'b', 'b', 'b', 'a', 'a', 'c', 'a'};
    int Len = 10;
    std::cout << Number_Of_Smiles(smiles, Len);
}

int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: redeclaration of 'char smiles [21]'
   12 |     char smiles[21] = {'a', 'a', 'b', 'b', 'b', 'b', 'a', 'a', 'c', 'a'};
      |          ^~~~~~
a.cc:9:10: note: 'char smiles [21]' previously declared here
    9 |     char smiles[21] = {'x', 'x', 'z', 'a', 'f', 'f', 'e', 'e', 'e', 'e', 'd', 'd', 'f', 'k', 'k', 'k', 'k', 'l', 'l', 'q'};
      |          ^~~~~~
a.cc:13:9: error: redeclaration of 'int Len'
   13 |     int Len = 10;
      |         ^~~
a.cc:10:9: note: 'int Len' previously declared here
   10 |     int Len = 20;
      |         ^~~
Language: C++


#include <iostream>
#include <string>

int Number_Of_Smiles(char *inputString, int Len);

int main()
{
    std::cout << Number_Of_Smiles(smiles, Len);
}

int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:35: error: 'smiles' was not declared in this scope
    9 |     std::cout << Number_Of_Smiles(smiles, Len);
      |                                   ^~~~~~
a.cc:9:43: error: 'Len' was not declared in this scope
    9 |     std::cout << Number_Of_Smiles(smiles, Len);
      |                                           ^~~
Language: C++

#include <iostream>
#include <string>


int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}

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

#include <iostream>
#include <string>

int Number_Of_Smiles(char *inputString, int Len);

int main()
{
    char smiles[21] = {'x', 'x', 'z', 'a', 'f', 'f', 'e', 'e', 'e', 'e', 'd', 'd', 'f', 'k', 'k', 'k', 'k', 'l', 'l', 'q'};
    //char smiles[6] = {'a', 'a', 'a', 'a', 'a', '\0'};
    //char smiles[11] = {'x', 'a', 'b', 'b', 'b', 'b', 'a', 'a', 'c', 'a', '\0'};
    int Len = 20;
    cout << Number_Of_Smiles(smiles, Len);
}

int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     cout << Number_Of_Smiles(smiles, Len);
      |     ^~~~
      |     std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <string>

int Number_Of_Smiles(char *inputString, int Len);

int main()
{
    char smiles[21] = {'x', 'x', 'z', 'a', 'f', 'f', 'e', 'e', 'e', 'e', 'd', 'd', 'f', 'k', 'k', 'k', 'k', 'l', 'l', 'q'};
    //char smiles[6] = {'a', 'a', 'a', 'a', 'a', '\0'};
    //char smiles[11] = {'x', 'a', 'b', 'b', 'b', 'b', 'a', 'a', 'c', 'a', '\0'};
    int Len = 20;
    std::cout << Number_Of_Smiles(smiles, Len);
}

int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'cout' is not a member of 'std'
   11 |     std::cout << Number_Of_Smiles(smiles, Len);
      |          ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 |
Language: C++

int Number_Of_Smiles(char *inputString, int Len);

int main()
{
    char smiles[21] = {'x', 'x', 'z', 'a', 'f', 'f', 'e', 'e', 'e', 'e', 'd', 'd', 'f', 'k', 'k', 'k', 'k', 'l', 'l', 'q'};
    //char smiles[6] = {'a', 'a', 'a', 'a', 'a', '\0'};
    //char smiles[11] = {'x', 'a', 'b', 'b', 'b', 'b', 'a', 'a', 'c', 'a', '\0'};
    int Len = 20;
    std::cout << Number_Of_Smiles(smiles, Len);
}

int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'cout' is not a member of 'std'
    9 |     std::cout << Number_Of_Smiles(smiles, Len);
      |          ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int Number_Of_Smiles(char *inputString, int Len);
Language: C++

#include <iostream>
#include <string>

int Number_Of_Smiles(char *inputString, int Len);

int Number_Of_Smiles(char *inputString, int Len)
{
    int smilesCount = 0;
    for (int i = 0; i < Len - 1; i++)
    {
        if (inputString[i] != inputString[i + 1])
        {
            smilesCount++;
        }
        else
        {
            
        }
    }
    
    return smilesCount + 1;
}

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

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

using namespace std;

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

Compiler output:
a.cc:7:1: error: '::main' must return 'int'
    7 | void main()
      | ^~~~
Language: C++

#include <iostream>
#include<string>
using namespace std;
void main()
{
	int n;
	string x;
	cin>>n;
	cin>>x;
	int counter = 1;
	for (int i = 1; i < n; i++)
	{
		if (x[i] != x[i - 1])
			counter++;
	}
	cout << counter<<endl;
}


Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~