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

#include <iostream>
using namespace std;
int main() {
	int n, k;
	string s[a];
	cin >> n >> s[a] >> k;
	a=n;
	for (int i = 0; i <= a; i++) {
		if (s[i] == s[k]) {
			s[i] = "*";
		}
	}
	cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: 'a' was not declared in this scope
    5 |         string s[a];
      |                  ^
a.cc:6:21: error: 's' was not declared in this scope
    6 |         cin >> n >> s[a] >> k;
      |                     ^
Language: C++

#include <iostream>
using namespace std;
int main() {
	int n, k;
	string s[a];
	cin >> n >> s[n] >> k;
	a=n;
	for (int i = 0; i <= a; i++) {
		if (s[i] == s[k]) {
			s[i] = "*";
		}
	}
	cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: 'a' was not declared in this scope
    5 |         string s[a];
      |                  ^
a.cc:6:21: error: 's' was not declared in this scope
    6 |         cin >> n >> s[n] >> k;
      |                     ^
Language: C++

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

 int main() {
     int N;
     cin >> N;
     
     string S;
     cin >> S;
     
     int K;
     cin >> K;
     
     
     for (int i = 0; i < N; i++){
     
     S.at(K) == '*'
  
   cout << S.at(i);
 }
       cout << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: expected ';' before 'cout'
   17 |      S.at(K) == '*'
      |                    ^
      |                    ;
   18 | 
   19 |    cout << S.at(i);
      |    ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,K;
 string S;
  cin >>N>>S>>K;
 char miss = S.at(K);

  for (int i = 0; i < N; i++) {
   if (miss != S.at(i)) {
    S.at(i)="*"  ;
   }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   12 |     S.at(i)="*"  ;
      |             ^~~
      |             |
      |             const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,K;
 string S;
  cin >>N>>S>>K;
  
 char miss = S.at(K);
  for (int i = 0; i < N; i++) {
   if (miss != S.at(i)) {
    S.at(i)=* ;
   }
  }
}
     

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected primary-expression before ';' token
   12 |     S.at(i)=* ;
      |               ^
Language: Java

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int length = sc.nextInt();
        String str = sc.next();
        int index = sc.nextInt();
        System.out.println(str.replaceAll("[^" + String.valueOf(str.charAt(index-1))  +"]","*"));
    }
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	string s[n];
	cin>>n>>s[n]>>k;
	for(int i=0;i<=n;i++){
		if(s[i]==s[k]){
			s[i]="*"
		}
	}
cout<<s<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: expected ';' before '}' token
    9 |                         s[i]="*"
      |                                 ^
      |                                 ;
   10 |                 }
      |                 ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	string s[n];
	cin>>n>>s[n]>>k;
	for(i=0;i<=n;i++){
		if(s[i]==s[k]){
			s[i]="*"
		}
	}
cout<<s<<endl;
}


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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		
		int a = sc.nextInt();
		
		String input = sc.nextLine();
		
		int b = sc.nextInt();
		
		StringBuilder s =new StringBuilder();
		s.append(input);
		
		String t = s.substring(b-1,b);
		
		
		
		for(int i = 1; i <= a; i++) {
			if(t.equals(s.substring(i-1,i)) != true) {
				s.replace(i-1, i,"*");
			}
		}
		
	
		System.out.println(s);
	}

}

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

#include<stdio.h>
int main(void){
  int k,n,i;
  char s[n+1];
  char t[n+1];
  for(i==1;i<n;i++){
    if(s[i] == s[k]){t[i]=s[i];}
    else{t[i]=*;}
  }
  printf("%s",t);
}


Compiler output:
main.c: In function 'main':
main.c:8:16: error: expected expression before ';' token
    8 |     else{t[i]=*;}
      |                ^
Language: C

#include<stdio.h>
int main(void){
  int k,n,i;
  char s[n+1];
  char t[n+1];
  for(i==1,i<n,i++){
    if(s[i] == s[k]){t[i]=s[i];}
    else{t[i]=*;}
  }
  printf("%s",t);
}

Compiler output:
main.c: In function 'main':
main.c:6:19: error: expected ';' before ')' token
    6 |   for(i==1,i<n,i++){
      |                   ^
      |                   ;
main.c:6:19: error: expected expression before ')' token
main.c:8:16: error: expected expression before ';' token
    8 |     else{t[i]=*;}
      |                ^
Language: C++

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

int main(void){

  char  *s;
  int   n, k, i;

  scanf("%d", &n);
  s = malloc(n * sizeof(s));
  scanf("%s", s);
  scanf("%d", &k);

  for (i = 0; i < n; i++) {
    if (s[i] != s[k - 1]) {
      s[i] = '*';
    }
  }

  printf(s);

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
   10 |   s = malloc(n * sizeof(s));
      |       ~~~~~~^~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C

#include <stdio.h>
int main() {
int n,k,i,j;
scanf("%d",&n);
if(n<10) {
char s[n];
scanf("%s",s);
scanf("%d",&k);
 }
char c;
if(k<1 && k<10) {
c=s[k-1];
for(i=0;i<n;i++) {
  if(s[i] == c) {
     continue;
   }
  else {
     s[i] = '*';
  }
 }
}
 
 printf("%s",s);
 
}

Compiler output:
main.c: In function 'main':
main.c:12:3: error: 's' undeclared (first use in this function)
   12 | c=s[k-1];
      |   ^
main.c:12:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){
    int N, K;
    char S[10];

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

    for(int i = 0; i < N; i++)
        if(S[i] == S[K]) S[i] = '*';
    }

    printf("%s", S);

}


Compiler output:
main.c:13:12: error: expected declaration specifiers or '...' before string constant
   13 |     printf("%s", S);
      |            ^~~~
main.c:13:18: error: unknown type name 'S'
   13 |     printf("%s", S);
      |                  ^
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
	int N, K,i;
	char S['%d', &N];
	scanf("%s", &S);
	scanf("%d", &K;
	for (i = 0; i <= N; i++) {
		if (S[K] != S[i]) {
			S[i] = *;
		}
	}
	return 0;
}

Compiler output:
a.cc:5:16: warning: multi-character character constant [-Wmultichar]
    5 |         char S['%d', &N];
      |                ^~~~
a.cc: In function 'int main()':
a.cc:5:20: error: expected ']' before ',' token
    5 |         char S['%d', &N];
      |                    ^
      |                    ]
a.cc:5:24: error: expected initializer before ']' token
    5 |         char S['%d', &N];
      |                        ^
a.cc:6:22: error: 'S' was not declared in this scope
    6 |         scanf("%s", &S);
      |                      ^
a.cc:7:23: error: expected ')' before ';' token
    7 |         scanf("%d", &K;
      |              ~        ^
      |                       )
a.cc:10:33: error: expected primary-expression before ';' token
   10 |                         S[i] = *;
      |                                 ^
Language: C

#include<stdio.h>

int main(){
	int n,k;
	char s[n];

	scanf("%d",&n);
	scanf("%s",&s[n]);
	scanf("%d",&k);

	for (int i = 0; i < n; i++){
		if (s[i] != s[k]){
			s[i] = *;
		}else{

		}
	}

	for (int j = 0; j < n; j++){
		printf("%s",s[j]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:33: error: expected expression before ';' token
   13 |                         s[i] = *;
      |                                 ^
Language: C++

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

int main(int argc, char* argv[]) {
    int n, k;
    scanf_s("%d", &n);
    char s[n];
    scanf_s("%s", s);
    scanf_s("%d", &k);
    char ejectChar;
    ejectChar = s[k-1];
    for (int i=0; i<n-1; i++) {
        if (s[i] != ejectChar) {
            s[i] = '*';
        }
    }
    cout << s << endl;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:7:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    7 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C

#include <stdio.h>

int main(void){
    int N, K;
    char S[10];

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

    for(int i = 0; i < N; i++)
        if(S[i] == S[K]) S[i] = '*';
    }

    printf("%c", S);

}


Compiler output:
main.c:13:12: error: expected declaration specifiers or '...' before string constant
   13 |     printf("%c", S);
      |            ^~~~
main.c:13:18: error: unknown type name 'S'
   13 |     printf("%c", S);
      |                  ^
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
Language: C++

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

int main() {
    int n, k;
    scanf_s("%d", &n);
    char s[n];
    scanf_s("%s", s);
    scanf_s("%d", &k);
    char ejectChar;
    ejectChar = s[k-1];
    for (int i=0; i<n-1; i++) {
        if (s[i] != ejectChar) {
            s[i] = '*';
        }
    }
    cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    7 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C

#include <stdio.h>

int main(void){
    int N, K;
    char S[10];

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

    for(int i = 0; i < N; i++)
        if(S[i] == S[K]) S[i] = '*';
    }

    printf("%c", *S);

}


Compiler output:
main.c:13:12: error: expected declaration specifiers or '...' before string constant
   13 |     printf("%c", *S);
      |            ^~~~
main.c:13:18: error: expected declaration specifiers or '...' before '*' token
   13 |     printf("%c", *S);
      |                  ^
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
Language: C

#include <stdio.h>

int main(){
	int n,k;
	char s[n];

	scanf("%d",&n);
	scanf("%s",&s[n]);
	scanf("%d",&k);

	for (int i = 0; i < n; i++){
		if (s[i] != s[k]){
			s[i] = *;
		}
	}

	for (int j = 0; j < n; j++){
		printf("%s",s[j]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:33: error: expected expression before ';' token
   13 |                         s[i] = *;
      |                                 ^
Language: C

#include <stdio.h>

int main(){
	int n,k;
	char s[n];

	scanf("%d",&n);
	scanf("%s",s[n]);
	scanf("%d",&k);

	for (int i = 0; i < n; i++){
		if (s[i] != s[k]){
			s[i] = *;
		}
	}

	for (int j = 0; j < n; j++){
		printf("%s",s[j]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:33: error: expected expression before ';' token
   13 |                         s[i] = *;
      |                                 ^
Language: C

#include <stdio.h>

int main(void){
    int N, K;
    char S[10];

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

    for(int i = 0; i < N; i++)
        if(S[i] == S[K]) S[i] = '*';
    }

    printf("%s", S);

}

Compiler output:
main.c:13:12: error: expected declaration specifiers or '...' before string constant
   13 |     printf("%s", S);
      |            ^~~~
main.c:13:18: error: unknown type name 'S'
   13 |     printf("%s", S);
      |                  ^
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int i,n,k;
  string s;
  cin >> n >> s >> k;
for (i=0;i<n;i++)
  {if (s[i] != s[k]) (char)s[i] = "*";}
 cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: lvalue required as left operand of assignment
    9 |   {if (s[i] != s[k]) (char)s[i] = "*";}
Language: C++

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

int main() {
    string s;
    int n,k;
    cin >> n >> s >> k;
    char a=s.at(k);
    for(int i=0;i<n;i++){
        if(s.at(i)!=a){
            s.at(i)='*'
        }
    }
    cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before '}' token
   11 |             s.at(i)='*'
      |                        ^
      |                        ;
   12 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K; string S; cin >> N >> S >> K;
  char x;
  x = S[K-1];
  
  for (int i = 0; i < N; ++i) {
    if (S[i] != x) {
      S.replace(i, 1, "*");
    }
  }
  
  cout << S << endl;
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected '}' at end of input
   15 |   return 0;
      |            ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
public class Main2 {
    public static void main(String args[]){
        Scanner sn = new Scanner(System.in);
        ArrayList<String> li = new ArrayList<String>();
        while (sn.hasNextLine()) {
            String str = sn.nextLine();
            li.add(str);
        }
        String[] array = li.toArray(new String[li.size()]);
        String[] moji = array[1].split("");
        String told = array[1];
        int mojime = new Integer(array[2]).intValue();
        String t = told.substring(mojime+1,mojime+1);
        int mojisu = new Integer(array[0]).intValue();
        for(int i=0;i<mojisu;i++){
            if(moji[i]==t){
            }
            else if(moji[i]!=t){
                moji[i]="*";
            }
        }
        System.out.println(moji);
    }
}


Compiler output:
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
Main.java:14: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
        int mojime = new Integer(array[2]).intValue();
                     ^
Main.java:16: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
        int mojisu = new Integer(array[0]).intValue();
                     ^
1 error
2 warnings
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected primary-expression before ';' token
   10 |   S.at(i)=*;
      |            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |   {if (s[i] != s[k])s[i] = "*";}
      |                            ^~~
      |                            |
      |                            const char*
Language: C++

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

int main(){
int N;string S;int K;
cin >>N;cin >>S;cin >>K;

for (int i = 0; i < N-1; i++) {
  if(S.at(i)!=S.at(K)){
  S.at(i)="*";
   }
  }
cout << S<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   10 |   S.at(i)="*";
      |           ^~~
      |           |
      |           const char*
Language: C++

#include<iosteream>
using namespaece std;

int main(){
  int n,k;
  string s;
  cin >> n >> s >> k;

  for(int i = 0; i < n;i++){
    if(s[i] == s[k]){
      cout << "*"
    }
    else{
      cout << s[i]
    }
  }

  cout << endl;

  return 0;
}


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

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

int main() {
	int N;
	cin >> N;
	char a[];
	cin >> a;
	int K;
	cin >> K;
	for (int i = 0; i < N; i++) {
		if (a[i] != a[K-1]) {
			a[i] = '*';
		}
	}
	cout << a << endl;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |   if (s[i] != s[k])s[i] = "*";
      |                           ^~~
      |                           |
      |                           const char*
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
public class Main2 {
    public static void main(String args[]){
        Scanner sn = new Scanner(System.in);
        ArrayList<String> li = new ArrayList<String>();
        while (sn.hasNextLine()) {
            String str = sn.nextLine();
            li.add(str);
        }
        String[] moji = li[1].split("");
        String t = li.substring(li[2]+1,li[2]+1);
        for(int i=0;i<(int)li[0];i++){
            if(moji[i]==t){
            }
            else if(moji[i]!=t){
                moji[i]="*";
            }
        }
        System.out.println(moji);
    }
}


Compiler output:
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
Main.java:11: error: array required, but ArrayList<String> found
        String[] moji = li[1].split("");
                          ^
Main.java:12: error: array required, but ArrayList<String> found
        String t = li.substring(li[2]+1,li[2]+1);
                                  ^
Main.java:12: error: array required, but ArrayList<String> found
        String t = li.substring(li[2]+1,li[2]+1);
                                          ^
Main.java:13: error: array required, but ArrayList<String> found
        for(int i=0;i<(int)li[0];i++){
                             ^
5 errors
Language: C++

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

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

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int k,n;
    string s;
    cin >> n >> s >> k;
    
    for (int i=0;i<N;i++){
    if (s[i] != s[k+1]) s[i] = '*';
    }
    
    cout <<  s << endl;
}

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

n = int(input())
s = str(input())
k = int(input())
 
a = ""
 
for i in range(n):
  if s[i] == s[k]:
    a = a + s[k]
  else:
    a = a + "*"
 
print(a)

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K; char S; cin >> N >> S >> K;
  char x;
  x = S[K-1];
  
  for (int i = 0; i < N; ++i) {
    if (S[i] != x) {
      S.replace(i, 1, "*");
    }
  }
  
  cout << S << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: invalid types 'char[int]' for array subscript
    6 |   x = S[K-1];
      |        ^
a.cc:9:10: error: invalid types 'char[int]' for array subscript
    9 |     if (S[i] != x) {
      |          ^
a.cc:10:9: error: request for member 'replace' in 'S', which is of non-class type 'char'
   10 |       S.replace(i, 1, "*");
      |         ^~~~~~~
Language: C++

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

int main() {
    string s;
    int n,k;
    cin >> n >> s >> k;
    char a=s.at(k)
    for(int i=0;i<n;i++){
        if(s.at(i)!=a){
            s.at(i)='*'
        }
    }
    cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(int i=0;i<n;i++){
      |     ^~~
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int i=0;i<n;i++){
      |                 ^
Language: C++

n = input()
word = input()
a= input()
b=0
x=word[int(a)]
 
for i in range(int(n)):
    if word[i] == x:
         b=0
    else:
        word[i]='*'
print(word)

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

import java.util.Scanner;
public class Main2 {

	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		int k = sc.nextInt();
		char a= s.charAt(k-1);
		StringBuilder aa = new StringBuilder();
		aa.append(s);
		sc.close();
	for(int i =0; i<n; i++) {
    if(s.charAt(i)!=a)
    	aa.setCharAt(i, '*');
	}
	String ans = aa.toString();

	System.out.println(ans);

	}

}


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

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

int main() {
    string s;
    int n,k;
    cin >> n >> s >> k;
    chsr a=s.at(k)
    for(int i=0;i<n;i++){
        if(s.at(i)!=a){
            s.at(i)='*'
        }
    }
    cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'chsr' was not declared in this scope; did you mean 'char'?
    8 |     chsr a=s.at(k)
      |     ^~~~
      |     char
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int i=0;i<n;i++){
      |                 ^
Language: C++

#include<iostream>
#include<stdio.h>

using namespace std;

int main(void){
    int l, N,n,i = 0, S[N+1],K;

    cin >> N;
    n = N;
    for(i = 0; i < N; i++){
        cin >> l;
        S[i] = l;

    }

    cin >> K;
    S[K-1]

    for(int i = 0; i < N; i++){
        if(S[i] != S[K-1]){
            S[i] = '*'
        }
    }

    printf("%s\n",S);


}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: expected ';' before 'for'
   18 |     S[K-1]
      |           ^
      |           ;
   19 | 
   20 |     for(int i = 0; i < N; i++){
      |     ~~~    
a.cc:20:30: error: expected ';' before ')' token
   20 |     for(int i = 0; i < N; i++){
      |                              ^
      |                              ;
Language: C++

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


int main(){
	int n,k;
	char ch;
	string s;
	cin >> n >> s >> k;
	
	ch=s[k-1];
	for(int i=0;i<n;i++){
		if(s[i]!=ch){
			s[i]='*';		
	}
	
	for(int i=0;i<n;i++){
		cout << s[i];
	}
	cout << endl;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
	int N, K;
	string S;
	cin >> N >> S >> K;
	sk = S[K];
	for(int i = 0; i < N; i++){
		if(S[i] != sk)
			S[i] = '*';
	}
	cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'sk' was not declared in this scope
    7 |         sk = S[K];
      |         ^~
Language: C

#include <stdio.h>
int main(void){
    int N,K;
    scanf("%d",&N);
    char S[N];
    scanf("%s",&S);
    scanf("%d",&K);
    
    for(int i=0;i<N;i++)　if(S[i]!=S[K-1]) S[i]='*';
    
    printf("%s",S);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:25: error: stray '\343' in program
    9 |     for(int i=0;i<N;i++)<U+3000>if(S[i]!=S[K-1]) S[i]='*';
      |                         ^~~~~~~~
Language: Java

import java.util.Scanner;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S = sc.next();

		
		char it = S.charAt(K-1);

		for (int i = 0; i< S.length(); i++) {
			if (it != S.charAt(i)) {
				S = S.substring(0,i)+ '*' +S.substring(i+1);
			}
		}
		System.out.println(S);
	}
}	


Compiler output:
Main.java:12: error: cannot find symbol
		char it = S.charAt(K-1);
		                   ^
  symbol:   variable K
  location: class Main
1 error
Language: C++

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

int main(){
    int n,k;
    string s;
    cin >> n >> s >> k;

    ans=s[k-1];
    for(int i=0;i<n;i++)
    {
        if(ans==s[i])cout << ans;
        else cout << "*";
    }
    cout <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans=s[k-1];
      |     ^~~
      |     abs
Language: C

include<stdio.h>

int main(){

	char S[10];
	int N,K,i;
	
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%c",S[i]);
	}
	scanf("%d",K);
	
	for(i=0;i<N;i++){
		if(S[i]!='K')S[i]=='*';
	}

	printf("%s\n",S);

}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:7:13: error: variable-sized object may not be initialized except with an empty initializer
    7 |   char d[a]=b;
      |             ^
main.c:9:8: error: 'i' undeclared (first use in this function)
    9 |   for (i=1;i<=a;i++){
      |        ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include<stdio.h>

int main(){

	char S[10];
	int N,K,i;
	
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%c",S[i]);
	}
	scanf("%d",K);
	
	for(i=0;i<N;i++){
		if(S[i]!='K')S[i]=='*';
	}

}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstdint>
#include <cmath>
#include <numeric>
#include <functional>
#include <queue>
#include <stack>
#include <string>

using namespace std;

int main()
{

  int n;
  string s;
  int k;
  cin >> n;
  cin >> s;
  cin >> k;

  char c = s[k];

  for(int i = 0;
      i < N;
      ++i)
    {
      if(s[i] != c)
        {
          s[i] = '*';
        }
    }

  cout << s << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: 'N' was not declared in this scope
   28 |       i < N;
      |           ^
Language: Java

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

public class Main {
    private static Scanner sc;
    public static void main(String[] args) {
        Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private void solve() {
        try {
            int N = sc.nextInt();
            String S = sc.next();
            int K = sc.nextInt();
            char C = S.charAt(K-1);
            StringBuilder sb = new StringBuilder();
            sb.append(S);
            for (int i = 0; i < N; i++) {
                if (S.charAt(i) != C) {
                    sb.setCharAt(i, '*');
                }
            }
            System.out.println(sb.toString());

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null) br.close();
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String st = br.readLine();
            while (st == "") st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }


Compiler output:
Main.java:79: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else
      |     ^~~~
Language: C++

int main(void)
{
    int n,k,i;
    char s[11];
    scanf("%d%s%d", &n,s,&k);
    for(i=0; i<n; i++)
    {
        if(strncmp(&s[k-1], &s[i], 1)==0) printf("%c", s[i]);
        else printf("*");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'scanf' was not declared in this scope
    5 |     scanf("%d%s%d", &n,s,&k);
      |     ^~~~~
a.cc:8:12: error: 'strncmp' was not declared in this scope
    8 |         if(strncmp(&s[k-1], &s[i], 1)==0) printf("%c", s[i]);
      |            ^~~~~~~
a.cc:1:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int main(void)
a.cc:8:43: error: 'printf' was not declared in this scope
    8 |         if(strncmp(&s[k-1], &s[i], 1)==0) printf("%c", s[i]);
      |                                           ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void)
a.cc:9:14: error: 'printf' was not declared in this scope
    9 |         else printf("*");
      |              ^~~~~~
a.cc:9:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <string>
#include <cstdlib>
#include <iostream>


int main(int argc, const char *argv[])
{
    int N;
    std::string S;
    int K;

    std::string buf;
    std::getline(std::cin, buf);
    N = std::atoi(buf);
    std::getline(std::cin, S);
    std::getline(std::cin, buf);
    K = std::atoi(buf);

    char c = S[K];
    for (int i = 0; i < N; i++) {
        if (S[i] != c) S[i] = '*';
    }
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   14 |     N = std::atoi(buf);
      |                   ^~~
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:17:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   17 |     K = std::atoi(buf);
      |                   ^~~
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

#include <stdio.h>

int main(void) {
  int s, snum;
  scanf("%d\n", &s);
  char S[s], char schar;
  int num[s];
  scanf("%s\n", S);
  scanf("&d\n", &snum);
  schar = S[snum];
  for(int i; i >= s; i1++) {
    if(S[i] == schar){
      num[i] = 1;
    } else {
      num[i] = 0;
    }
    if(num[i] == 0) {
     S[i] = '*';
    }
  }
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:6:14: error: expected identifier or '(' before 'char'
    6 |   char S[s], char schar;
      |              ^~~~
main.c:10:3: error: 'schar' undeclared (first use in this function); did you mean 'char'?
   10 |   schar = S[snum];
      |   ^~~~~
      |   char
main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:22: error: 'i1' undeclared (first use in this function); did you mean 'i'?
   11 |   for(int i; i >= s; i1++) {
      |                      ^~
      |                      i
Language: Java

import java.util.Scanner;

public class AtCoder {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String S = sc.next();

        int K = sc.nextInt();

        char c = S.charAt(K-1);

        StringBuilder sb  = new StringBuilder();
        for (int i = 0; i <N ; i++) {
            char c2  = S.charAt(i);

            if(c2 != c ){
                sb.append("*");
            }else{
                sb.append(c2);
            }
        }

        System.out.println(sb.toString());
    }

}


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

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

int main(){
  int n,k;
  string s;
  cin >> n;
  cin >> s;
  cin >> k;
  char rem;
  rem = s[k-1];
  
  for (int i =0; i < n; i++){
    if (!(s[i] == rem)){
      s[i] = "*";
    }
  }
  cout << s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   17 |       s[i] = "*";
      |              ^~~
      |              |
      |              const char*
Language: C++

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

int main() {
  int N,K;
  string S;
  cin >> N >> S >> K;
  char a=S.at(K);
  for(int i=0;i<N;i++){
    if(S.at(i)==a){
    S.at(i)=*;
    }
    cout << S <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected primary-expression before ';' token
   11 |     S.at(i)=*;
      |              ^
Language: C++

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

int main(){
    int n,k;
    char s[11];
    scanf("%d%s%d,&n,s,&k);
    for(int i=0;i<n;i++)printf("%c",s[i]==s[k-1]?s[k-1]:'*');
    printf("%c",'\n');
    return 0;
}

Compiler output:
a.cc:7:11: warning: missing terminating " character
    7 |     scanf("%d%s%d,&n,s,&k);
      |           ^
a.cc:7:11: error: missing terminating " character
    7 |     scanf("%d%s%d,&n,s,&k);
      |           ^~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: expected primary-expression before 'for'
    8 |     for(int i=0;i<n;i++)printf("%c",s[i]==s[k-1]?s[k-1]:'*');
      |     ^~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |     for(int i=0;i<n;i++)printf("%c",s[i]==s[k-1]?s[k-1]:'*');
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int N, K;
	string S;
	cin >> N >> S >> K;
	sk = S[K];
	for(int i = 0; i < N; i++){
		if(S[i] != sk)
			S[i] = '*'
	}
	cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'sk' was not declared in this scope
    7 |         sk = S[K];
      |         ^~
a.cc:10:35: error: expected ';' before '}' token
   10 |                         S[i] = '*'
      |                                   ^
      |                                   ;
   11 |         }
      |         ~
Language: C++

N=int(input())
S=input()
K=int(input())

onaji=S[K-1]
ans=""
for i in range(N):
    if S[i]==onaji:
        ans+=onaji
    else:
        ans+="*"
print(ans)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt;
		String b = sc.nextLine;
		int c = sc.nextInt;
		String[] d = b.split("");

		String save = d[c-1];
		for (int i=0;i<a;i++){
			if(d[i].equals(save)){
				d[i] ="*";
			}
		}
		for(int i=0;i<a;i++){
			System.out.print(d[i]);
		}
		System.out.println();
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		int a = sc.nextInt;
		          ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
		String b = sc.nextLine;
		             ^
  symbol:   variable nextLine
  location: variable sc of type Scanner
Main.java:8: error: cannot find symbol
		int c = sc.nextInt;
		          ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
3 errors
Language: C++

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

int main()
{
  string S;
  int N, K;
  cin >> N >> S >> K;
  
  char c = S[K-1];
  
  for (int i = 0; i < S.size(); ++i)
    if (S[i] != c)
      S[i] = "*";
  
  cout << S;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   15 |       S[i] = "*";
      |              ^~~
      |              |
      |              const char*
Language: C++

# coding: utf-8
import re
import bisect
from datetime import datetime as dt
N = input()
S = raw_input()
K = input()
a = S[K - 1]
b = ''
for i in range(len(S)):
    if S[i] != a:
        b += '*'
    else:
        b += a
print b


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:9:5: error: empty character constant
    9 | b = ''
      |     ^~
a.cc:2:1: error: 'import' does not name a type
    2 | import re
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main(void){
  int n;
  cin >> n;
  
  string word;
  cin >> word;
  
  int k;
  cin >> k;
  
  char p = word[k-1];
  for(int i=0;i<n;i++){
    if(word[i] != p){
      word[i] = '*';
    }
    
    cout << word << endl;
    
    return 0;
  }

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

#include <stdio.h>
void main()
{
	int N, K;
	char S[11];
	scanf("%d%s%d", &N, S, &K);
	int i;
	for (i = 0; S[i] != '\0'; i++) {
		if (S[i] != S[K-1])S[i] = '*';
	}
	printf("%s\n", S);
}

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

#include<iostream>
#include<algorihtm>
#include<string>
#include<vector>
#include<bits/stdc++.h>
#include<cmath>
using namespace etsd;

int main(){
  int N;
  cin>>N;
  char S[N];
  for(int i=0; i<N; ++i) cin>>S[i];
  int K;
  cin>>K;
  for(int i=0; i<N; ++i){
    if(S[i]!=S[K-1]) S[i]="*";
  }
  for(int i=0; i<N-1; ++i) cout<<S[i];
  cout<<S[N-1]<<endl;
  
}

Compiler output:
a.cc:2:9: fatal error: algorihtm: No such file or directory
    2 | #include<algorihtm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt;
		String b = sc.nextLine;
		int c = sc.nextInt;
		String[] d = b.split("");

		String save = d[c-1];
		for (int i=0;i<n;i++){
			if(d[i].equals(save)){
				d[i] ="*";
			}
		}
		for(int i=0;i<n;i++){
			System.out.print(d[i]);
		}
		System.out.println();
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		int a = sc.nextInt;
		          ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
		String b = sc.nextLine;
		             ^
  symbol:   variable nextLine
  location: variable sc of type Scanner
Main.java:8: error: cannot find symbol
		int c = sc.nextInt;
		          ^
  symbol:   variable nextInt
  location: variable sc of type Scanner
Main.java:12: error: cannot find symbol
		for (int i=0;i<n;i++){
		               ^
  symbol:   variable n
  location: class Main
Main.java:17: error: cannot find symbol
		for(int i=0;i<n;i++){
		              ^
  symbol:   variable n
  location: class Main
5 errors
Language: C++

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

int main() {

  int a,c;
  string b;
  cin >>a>>b>>c ;
for(int i=0;i<a;i++){
  if(b[i]==b[c-1]) {
  }
  else {
  b[i]='*'
  }
  }
cout<<b<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected ';' before '}' token
   13 |   b[i]='*'
      |           ^
      |           ;
   14 |   }
      |   ~
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<vector>
#define inf 2147483647
#define rep(i,a,b) for(int i=a;i<b;i++)
#define  rr read()
#define ll long long
#define repb(i,a,b) for(int i=a;i<=b;i++)
#define CloseIo   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
int read()
{
    char ch = getchar();
	int x = 0, f = 1;
    while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
    while('0' <= ch && ch <= '9')Q
	 else
	 printf("%c",s[i]);
}
}



Compiler output:
a.cc: In function 'int read()':
a.cc:25:34: error: 'Q' was not declared in this scope
   25 |     while('0' <= ch && ch <= '9')Q
      |                                  ^
a.cc:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^
a.cc: At global scope:
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
		Sccaner sc = new Scanner(System.in);
		int a = sc.nextInt;
		String b = sc.nextLine;
		int c = sc.nextInt;
		String[] d = b.split("");

		String save = d[c-1];
		for (int i=0;i<n;i++){
			if(d[i].equals(save)){
				d[i] ="*";
			}
		}
		for(int i=0;i<n;i++){
			System.out.print(d[i]);
		}
		System.out.println();
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Sccaner sc = new Scanner(System.in);
		^
  symbol:   class Sccaner
  location: class Main
Main.java:12: error: cannot find symbol
		for (int i=0;i<n;i++){
		               ^
  symbol:   variable n
  location: class Main
Main.java:17: error: cannot find symbol
		for(int i=0;i<n;i++){
		              ^
  symbol:   variable n
  location: class Main
3 errors
Language: C++

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

int main()
{
  string S;
  int N, K;
  cin >> N >> S >> K;
  
  char c = S[K];
  
  for (int i < 0; i < S.size(); ++i)
    if (S[i] != c)
      S[i] = "*";
  
  cout << S;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: expected ';' before '<' token
   13 |   for (int i < 0; i < S.size(); ++i)
      |             ^~
      |             ;
a.cc:13:14: error: expected primary-expression before '<' token
   13 |   for (int i < 0; i < S.size(); ++i)
      |              ^
a.cc:13:31: error: expected ')' before ';' token
   13 |   for (int i < 0; i < S.size(); ++i)
      |       ~                       ^
      |                               )
a.cc:13:35: error: 'i' was not declared in this scope
   13 |   for (int i < 0; i < S.size(); ++i)
      |                                   ^
Language: C++

n = gets.to_i
s = gets
k = gets.to_i

s = s.chars
ans = []
target = s[k-1]

s.each do|chara|
  if chara == target
    ans << chara
  else
    ans << "*"
  end
end

puts ans.join

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = gets.to_i
      | ^
Language: C++

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

int main(){
	int n;cin>>n;
	string s; cin >>s;
	int k; cin >>k;
	for(int j=0;j<s.size();j++){
		if(s[k-1]!=s[j])s[j]="*";
	}
	cout << s << endl;
}#

Compiler output:
a.cc:14:2: error: stray '#' in program
   14 | }#
      |  ^
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:15: error: 'cin' was not declared in this scope
    7 |         int n;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 | include <bits/stdc++.h>
a.cc:8:9: error: 'string' was not declared in this scope
    8 |         string s; cin >>s;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | include <bits/stdc++.h>
a.cc:8:25: error: 's' was not declared in this scope
    8 |         string s; cin >>s;
      |                         ^
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << s << endl;
      |         ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:22: error: 'endl' was not declared in this scope
   13 |         cout << s << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include <bits/stdc++.h>
Language: C++

n = int(input())
s = list(input())
k = int(input())
d = s[k - 1]
for i in range(n):
    if s[i] != d:
        s[i] = '*'
print(''.join(s))

Compiler output:
a.cc:8:7: error: empty character constant
    8 | print(''.join(s))
      |       ^~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^