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

import java.util.*

fun main(args: Array<String?>) {
    val scanner = Scanner(System.`in`)

    val n = scanner.nextInt()
    val k = scanner.nextInt()
    val s = scanner.next()

    s.toCharArray().let {
        it[k - 1] = it[k - 1].toLowerCase()
        println(it)
    }
}


Compiler output:
Main.java:1: error: ';' expected
import java.util.*
                  ^
Main.java:4: error: illegal character: '`'
    val scanner = Scanner(System.`in`)
                                 ^
Main.java:4: error: illegal character: '`'
    val scanner = Scanner(System.`in`)
                                    ^
3 errors
Language: C++

#include<stdio.h>

int main(){
  int N,K;
  char a[50];
  
  scanf("%d %d",&N,&K);
  scanf("%s",a);
  
  a[K-1]=tolower(a[K-1]);
  
  printf("%s",a);
  
  return 0;
}

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

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

int main(){
  int N,K;
  cin>>N;
  cin>>K;
  string A[N];
  for(int i=0;i<N;i++) cin>>A[i];
  for(int j=0;j<N;j++){
    if(j!=K-1) cout<<A[j];
    else cout<<tolower(A[j]);
  }
  cout<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: no matching function for call to 'tolower(std::string&)'
   13 |     else cout<<tolower(A[j]);
      |                ~~~~~~~^~~~~~
In file included from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/ios:43:
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)'
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:25: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, k;
  cin >> n >> k;
  sring s;
  cin >> s;
  if(s[k-1] == 'a') s[k-1] = 'A';
  if(s[k-1] == 'b') s[k-1] = 'B';
  if(s[k-1] == 'c') s[k-1] = 'C';
  cout << s << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'sring' was not declared in this scope
    6 |   sring s;
      |   ^~~~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
Language: C

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

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

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

Compiler output:
main.c:1:1: error: invalid suffix "include" on integer constant
    1 | 3include<stdio.h>
      | ^~~~~~~~
main.c:1:1: error: expected identifier or '(' before numeric constant
Language: C

#include<stdio.h>
int main(void){
  int A,C;
  char S[100];
  scanf("%d %d",&A,&C);
  scanf("%s",S);
  S[K]-=('a'-'A');
  printf("%s",S);
  return 0;
}

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

#include<stdio.h>
signed main(){
     int a, b;
     scanf("%d %d",&a,&b);
     if (a <=  5)
     printf ("0\n");
     else  if (a <= 12  &&  a >=  6)
     printf("%d\n",b/2);
    else  if(a >= 13)
    printf ("%d\n",b);
return(0);


Compiler output:
main.c: In function 'main':
main.c:11:1: error: expected declaration or statement at end of input
   11 | return(0);
      | ^~~~~~
Language: C

#include<stdio.h>
signed main(){
     int a, b;
     scanf("%d %d"&a,&b);
     if (a <= 5)
     printf ("0\n");
     else if (a <= 12  &&  a >=  6)
     printf("%d\n",b/2);
    else  if (a >= 13)
    printf ("%d\n",b);
return(0);


Compiler output:
main.c: In function 'main':
main.c:4:19: error: invalid operands to binary & (have 'char *' and 'int')
    4 |      scanf("%d %d"&a,&b);
      |            ~~~~~~~^
      |            |
      |            char *
main.c:11:1: error: expected declaration or statement at end of input
   11 | return(0);
      | ^~~~~~
Language: C

#include<stdio.h>
signed   main(){
     int a, b;
     scanf("%d %d"&a,&b);
     if (a <=  5)
     printf ("0\n");
     else  if (a <= 12  &&  a >=  6)
     printf("%d\n",b/2);
    else  
    printf ("%d\n",b);
return(0);


Compiler output:
main.c: In function 'main':
main.c:4:19: error: invalid operands to binary & (have 'char *' and 'int')
    4 |      scanf("%d %d"&a,&b);
      |            ~~~~~~~^
      |            |
      |            char *
main.c:11:1: error: expected declaration or statement at end of input
   11 | return(0);
      | ^~~~~~
Language: Java

import java.util.*;
 
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
      	String c = sc.nextString();
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
      	String c = sc.nextString();
      	             ^
  symbol:   method nextString()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.*;
 
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
      	String c = sc.nextString();
}

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

#include <string>

using namespace std;
int main(){
  string s;
  cin >> s;
  int n;
  cin >> n;
  s[n-1] ^= 32;
  cout << s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> s;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | 
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << s;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
      	String c = sc.nextString();
        if ((a * b) % 2 == 0)
    }
}

Compiler output:
Main.java:10: error: illegal start of statement
    }
    ^
1 error
Language: Java

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    val n =  readInt()

    for (i in 1 ..n){
        val s = readLn()
        val a = s.toList().sorted().joinToString(separator = "")
        val b = s.toList().sorted().reversed().joinToString(separator = "")
        if (a == b){
            println(-1)
        }else {
            println(a)
        }
    }
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
private fun readLn() = readLine()!! // string line
        ^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: ';' expected
private fun readLn() = readLine()!! // string line
                    ^
Main.java:2: error: ';' expected
private fun readInt() = readLn().toInt() // single int
                     ^
Main.java:3: error: ';' expected
private fun readStrings() = readLn().split(" ") // list of strings
                         ^
Main.java:4: error: ';' expected
private fun readInts() = readStrings().map { it.toInt() } // list of ints
                      ^
Main.java:4: error: ';' expected
private fun readInts() = readStrings().map { it.toInt() } // list of ints
                                                       ^
Main.java:9: error: illegal '.'
    for (i in 1 ..n){
                 ^
Main.java:9: error: not a statement
    for (i in 1 ..n){
                  ^
Main.java:9: error: ';' expected
    for (i in 1 ..n){
             ^
Main.java:9: error: ';' expected
    for (i in 1 ..n){
               ^
Main.java:9: error: illegal start of expression
    for (i in 1 ..n){
                ^
Main.java:9: error: ';' expected
    for (i in 1 ..n){
                   ^
Main.java:10: error: ';' expected
        val s = readLn()
                        ^
Main.java:11: error: ';' expected
        val a = s.toList().sorted().joinToString(separator = "")
                                                                ^
Main.java:12: error: ';' expected
        val b = s.toList().sorted().reversed().joinToString(separator = "")
                                                                           ^
Main.java:14: error: ';' expected
            println(-1)
                       ^
Main.java:16: error: ';' expected
            println(a)
                      ^
17 errors
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N, K;
  string s;
  cin >> N >> K;
  for(int i=0; i<N; i++){
    cin >> s[i];
  }
  if(s[K] == "A") s[K] == "a";
  elif if(s[K] == "B") s[K] == "b";
  elif if(s[K] == "C") s[K] == "c";
  cout << s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[K] == "A") s[K] == "a";
a.cc:11:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[K] == "A") s[K] == "a";
a.cc:12:3: error: 'elif' was not declared in this scope
   12 |   elif if(s[K] == "B") s[K] == "b";
      |   ^~~~
a.cc:13:7: error: expected ';' before 'if'
   13 |   elif if(s[K] == "C") s[K] == "c";
      |       ^~~
      |       ;
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N, K;
  string s;
  cin >> N >> K;
  for(i; i<N; i++){
    cin >> s[i];
  }
  if(s[K] == "A") s[K] == "a";
  elif if(s[K] == "B") s[K] == "b";
  elif if(s[K] == "C") s[K] == "c";
  cout << s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i; i<N; i++){
      |       ^
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[K] == "A") s[K] == "a";
a.cc:11:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[K] == "A") s[K] == "a";
a.cc:12:3: error: 'elif' was not declared in this scope
   12 |   elif if(s[K] == "B") s[K] == "b";
      |   ^~~~
a.cc:13:7: error: expected ';' before 'if'
   13 |   elif if(s[K] == "C") s[K] == "c";
      |       ^~~
      |       ;
Language: Java

import java.util.Scanner;
import java.lang.Character;

public class ChangingChar {
    public static void main (String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            int k = sc.nextInt();
            String s = sc.next();
            String res = "";
            char ch;            

            for (int i = 0; i < n; i++) {
                if (i == k - 1) {
                    ch = Character.toLowerCase(s.charAt(i));                
                }            
                else {
                    ch = s.charAt(i);
                }
                res += "" + ch;
            }
            System.out.println(res);
        }           
    }
}

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

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

int main()
{
  int N, K;
  string S;
  
  cin >> N >> K;
  cin >> S;
  S[K+1] = "a";
  
  for(int i=0; i<N; i++)
    cout << S[i];
}
  

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

a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:5: error: return type defaults to 'int' [-Wimplicit-int]
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      |     ^~~~
main.c: In function 'main':
main.c:1:5: error: type of 'k' defaults to 'int' [-Wimplicit-int]
main.c:1:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
main.c:1:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      |             ^~~~~
main.c:1:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:48: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      |                                                ^~~~
main.c:1:48: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:1:53: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types]
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      |                                                     ^
      |                                                     |
      |                                                     int *
main.c:1:53: note: expected 'const char *' but argument is of type 'int *'
main.c:1:55: error: expected ';' before '}' token
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      |                                                       ^
      |                                                       ;
main.c: At top level:
main.c:1:1: warning: array 'a' assumed to have one element
    1 | a[];main(k){scanf("%d %d %s",&k,&k,a);a[k]+=32;puts(a)}
      | ^
Language: C++

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

int main() {
   int N, K; string S;
  cin >> N >> K >> S;
 for ( int i = 0; i < 4; i++ ) {
   if (K - 1 == i) {
    if (S.at(K-1)=="A"){
      cout << "a";
    }
      if (S.at(K-1)=="B"){
      cout << "b";
    }
      if (S.at(K-1)=="C"){
      cout << "c";
    }
   }
   else cout << S.at(i)
 }
}  
     


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if (S.at(K-1)=="A"){
      |         ~~~~~~~~~^~~~~
a.cc:12:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if (S.at(K-1)=="B"){
      |           ~~~~~~~~~^~~~~
a.cc:15:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |       if (S.at(K-1)=="C"){
      |           ~~~~~~~~~^~~~~
a.cc:19:24: error: expected ';' before '}' token
   19 |    else cout << S.at(i)
      |                        ^
      |                        ;
   20 |  }
      |  ~
Language: C++

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

int main() {
   int N, K; string S;
  cin >> N >> K >> S;
 for ( int i = 0; i < 4; i++ ) {
   if (K - 1 == i) {
    if (S.at(K-1)==A){
      cout << a;
    }
      if (S.at(K-1)==B){
      cout << b;
    }
      if (S.at(K-1)==C){
      cout << c;
    }
   }
   else cout << S.at(i)
 }
}  
     


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'A' was not declared in this scope
    9 |     if (S.at(K-1)==A){
      |                    ^
a.cc:10:15: error: 'a' was not declared in this scope
   10 |       cout << a;
      |               ^
a.cc:12:22: error: 'B' was not declared in this scope
   12 |       if (S.at(K-1)==B){
      |                      ^
a.cc:13:15: error: 'b' was not declared in this scope
   13 |       cout << b;
      |               ^
a.cc:15:22: error: 'C' was not declared in this scope
   15 |       if (S.at(K-1)==C){
      |                      ^
a.cc:16:15: error: 'c' was not declared in this scope
   16 |       cout << c;
      |               ^
a.cc:19:24: error: expected ';' before '}' token
   19 |    else cout << S.at(i)
      |                        ^
      |                        ;
   20 |  }
      |  ~
Language: C++

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

int main() {
   int N, K; string S;
  cin >> N >> K >> S;
 for ( int i = 0; i < 4; i++ ) {
   if (K - 1 == i) {
    if (S.at(K-1)==A){
      cout << a;
    }
      if (S.at(K-1)==B){
      cout << b;
    }
      if (S.at(K-1)==C){
      cout << c;
    }
   }
   else cout << S.at(i)
 }
}  
     

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

#include <iostream>
using namespace std;
int main() {

char in[55];
int main(){
int a,b;scanf("%d%d",&a,&b);
scanf("%s",in);
in[b-1]+=32;
printf("%s\n",in);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    6 | int main(){
      |         ^~
a.cc:6:9: note: remove parentheses to default-initialize a variable
    6 | int main(){
      |         ^~
      |         --
a.cc:6:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:6:11: error: a function-definition is not allowed here before '{' token
    6 | int main(){
      |           ^
a.cc:11:2: error: expected '}' at end of input
   11 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C

#include<stdio.h>
int main(void){
  int N;
  int K;
  char s[50]:
  scanf("%d",&N);
  scanf("%d",&K);
  scanf("%s",&s);
  if(N>=K){
    if(s[K-1]<'a'){
      s[K-1]=s[K-1]+32;
              }else{
        s[K-1]=s[K-1]-32;
      }
    }
  printf("%s\n",s);
  }

Compiler output:
main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    5 |   char s[50]:
      |             ^
main.c:5:13: error: expected expression before ':' token
main.c:8:15: error: 's' undeclared (first use in this function)
    8 |   scanf("%s",&s);
      |               ^
main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
  int N;
  int K;
  char s[50]:
  scanf("%d",&N);
  scanf("%d",&K);
  scanf("%s",&s);
  if(N>=K){
    if(s[K-1]<'a'){
      s[K-1]=s{K-1]+32;
              }else{
        s[K-1]=s[K-1]-32;
      }
    }
  printf("%s\n",s);
  }

Compiler output:
main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    5 |   char s[50]:
      |             ^
main.c:5:13: error: expected expression before ':' token
main.c:8:15: error: 's' undeclared (first use in this function)
    8 |   scanf("%s",&s);
      |               ^
main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:15: error: expected ';' before '{' token
   11 |       s[K-1]=s{K-1]+32;
      |               ^
      |               ;
Language: C

#include<stdio.h>
int main(void){
  char s[50];
  int N;
  int K;
  scanf("%s",&s);
  scanf("%d",&N);
  scanf("%d",&K);
  if(k<=N){
    if(s[K-1]<'a'){
      s[K-1]=s[K-1]+32;
    }else{
      s[K-1]=s[K-1]-32;
    }
  }
  printf("%d",s);
}

Compiler output:
main.c: In function 'main':
main.c:9:6: error: 'k' undeclared (first use in this function)
    9 |   if(k<=N){
      |      ^
main.c:9:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>

using namespace std;

int main(void) {
    int n, u, v, w;
    cin >> n;
    cout << n << endl;
    int N[n+1];
    memset(N, 0xff, sizeof(N));

    while(1) {
        cin >> u >> v >> w;
        if( cin.eof() ){
            break;
        }
//      cout << u << " " << v << " " << w << endl;
        if ( N[u] == -1 && N[v] == -1 ){
//          cout << "-1-" << endl;
            N[u] = N[v] = (w%2);
        }
        else if (N[u] != -1 && N[v] == -1) {
//          cout << "-2-" << endl;
            N[v] = w%2 ? (N[u]+1)%2 : N[u];
        }
        else if (N[u] == -1 && N[v] != -1) {
//          cout << "-3-" << endl;
            N[u] = w%2 ? (N[v]+1)%2 : N[v];
        }
    }
    for( int i = 1; i<=n; i++ ){
        cout << N[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'memset' was not declared in this scope
   10 |     memset(N, 0xff, sizeof(N));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: Java

import java.util.*;
public class test {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int K = sc.nextInt();
		
		String S = sc.next();
		S = S.substring(0,K-1)+S.substring(K-1,K).toLowerCase()+S.substring(K);
		System.out.println(S);
	}

}

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

var c : array[1..50] of char;
    n, k : integer;
    i : integer;
begin
  read(n, k);
  readln();
  for i := 1 to n do read(c[i]);
  if c[k] = 'A' then c[k] := 'a';
  if c[k] = 'B' then c[k] := 'b';
  if c[k] = 'C' then c[k] := 'c';
  for i := 1 to n do write(c[i]);
end.


Compiler output:
a.cc:1:15: error: too many decimal points in number
    1 | var c : array[1..50] of char;
      |               ^~~~~
a.cc:1:1: error: 'var' does not name a type
    1 | var c : array[1..50] of char;
      | ^~~
a.cc:2:5: error: 'n' does not name a type
    2 |     n, k : integer;
      |     ^
a.cc:3:7: error: found ':' in nested-name-specifier, expected '::'
    3 |     i : integer;
      |       ^
      |       ::
a.cc:3:5: error: 'i' does not name a type
    3 |     i : integer;
      |     ^
a.cc:4:1: error: 'begin' does not name a type
    4 | begin
      | ^~~~~
a.cc:6:11: error: expected constructor, destructor, or type conversion before ';' token
    6 |   readln();
      |           ^
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for i := 1 to n do read(c[i]);
      |   ^~~
a.cc:8:3: error: expected unqualified-id before 'if'
    8 |   if c[k] = 'A' then c[k] := 'a';
      |   ^~
a.cc:9:3: error: expected unqualified-id before 'if'
    9 |   if c[k] = 'B' then c[k] := 'b';
      |   ^~
a.cc:10:3: error: expected unqualified-id before 'if'
   10 |   if c[k] = 'C' then c[k] := 'c';
      |   ^~
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for i := 1 to n do write(c[i]);
      |   ^~~
a.cc:12:1: error: 'end' does not name a type
   12 | end.
      | ^~~
Language: Java


import java.util.Scanner;

public class ChangingCharacter {

    public static void main(String[] args) {


        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        String s = in.next();
        char[] str = s.toCharArray();
        str[k-1] = Character.toLowerCase(str[k-1]);
        for(int i=0;i<n;i++){

            System.out.print(str[i]);
        }
    }

}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
    6 |     cin>>n>>k;
      |     ^~~
a.cc:11:15: error: 'k' was not declared in this scope
   11 |         if(i==k-1)
      |               ^
Language: C++

#include "stdafx.h"
#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>
#include <random>
#include <map>
#include <iomanip>
#include <sstream>

//AtCoderC++.cpp

using namespace std;


#define rep(i,from,to) for(int i=from;i<to;i++)
#define ints(name,n) vector<int> name;name.resize(n)

template<typename T> void Show(const vector<vector<T>>& v, string delimiter = " ") {
	for (int i = 0; i < v.size(); i++) {
		for (int j = 0; j < v[i].size(); j++) {
			cout << v[i][j];
			if (j != v[i].size() - 1) {
				cout << delimiter;
			} else {
				cout << endl;
			}
		}
	}
}
template<typename T> void Show(const vector<T>& v, string delimiter = " ") {
	for (int i = 0; i < v.size(); i++) {
		cout << v[i];
		if (i != v.size() - 1) {
			cout << delimiter;
		} else {
			cout << endl;
		}
	}
}
template<typename T> vector<T> getUniform(T value, int n) {
	vector<vector<T>> ts;
	ts.resize(n);
	for (int i = 0; i < n; i++) {
		ts[i] = value;
	}
	return ts;
}
template<typename T> vector<vector<T>> getUniform(T value, int row, int col) {
	vector<vector<T>> ts;
	ts.resize(row);
	for (int i = 0; i < row; i++) {
		ts[i].resize(col);
		for (int j = 0; j < col; j++) {
			ts[i][j] = value;
		}
	}
	return ts;
}
bool All(vector<vector<bool>> ts) {
	int h = ts.size();
	int w = ts[0].size();
	rep(i, 0, h) {
		rep(j, 0, w) {
			if (!ts[i][j])return false;
		}
	}
	return true;
}

int main() {
	int n, k;
	cin >> n >> k;
	char c;
	for (size_t i = 0; i < n; i++) {
		cin >> c;
		if (i == k - 1)c = tolower(c);
		cout << c;
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int fir,sec;
bool f,s;
int main(){
    scanf("%2d%2d",&fir,&sec);
    if(1<=fir&&fir<=12) f=1;
    if(1<=sec&&sec<=12) s=1;
    if(f&&s) printf("AMBIGUOUS");
    else if(f) cout<<("MMYY")endl;
    else if(s) cout<<"YYMM"<<endl;
    else cout<<"NA"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before 'endl'
   10 |     else if(f) cout<<("MMYY")endl;
      |                              ^~~~
      |                              ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int fir,sec;
bool f,s;
int main(){
    scanf("%2d%2d",&fir,&sec);
    if(1<=fir&&fir<=12) f=1;
    if(1<=sec&&sec<=12) s=1;
    if(f&&s) printf("AMBIGUOUS");
    else if(f) cout<<("MMYY")endl;
    else if(s) cout<<"YYMM"<<endl;
    else cout"NA"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before 'endl'
   10 |     else if(f) cout<<("MMYY")endl;
      |                              ^~~~
      |                              ;
a.cc:12:14: error: expected ';' before string constant
   12 |     else cout"NA"<<endl;
      |              ^~~~
      |              ;
Language: C++

#include<bits/std.h>
using namespace std;
 
int a,b;
int main(){
          bool t,f;
            scanf("%2d%2d",&a,&b);
              if(0<a&&a<13)t=1;
                if(0<b&&b<13)f=1;
                  if(t&&f)cout<<"AMBIGUOUS"<<endl;
                    else if(t)cout<<"YYMM"<<endl;
                      else if(f)cout<<"MMYY"<<endl;
                        else cout<<"NA";
}

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

#include<bits/std.h>
using namespace std;
 
int a,b;
int main(){
          bool t,f;
            scanf"(%2d%2d",&a,&b);
              if(0<a&&a<13)t=1;
                if(0<b&&b<13)f=1;
                  if(t&&f)cout<<"AMBIGUOUS"<<endl;
                    else if(t)cout<<"YYMM"<<endl;
                      else if(f)cout<<"MMYY"<<endl;
                        else cout<<"NA";
}

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

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

int a,b;
int main(){
          bool t,f;
            scanf"(%2d%2d",&a,&b);
              if(0<a&&a<13)t=1;
                if(0<b&&b<13)f=1;
                  if(t1&&f)cout<<"AMBIGUOUS"<<endl;
                    else if(t)cout<<"YYMM"<<endl;
                      else if(f)cout<<"MMYY"<<endl;
                        else cout<<"NA";
}

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

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

int a,b;
int main(){
          bool t,f;
            scanf"(%2d%2d",&a,&b);
              if(0<a&&a<13)t=1;
                if(0<b&&b<13)f=1;
                  if(t=1&&f=1)cout<<"AMBIGUOUS"<<endl;
                    else if(t=1)cout<<"YYMM"<<endl;
                      else if(f=1)cout<<"MMYY"<<endl;
                        else cout<<"NA";
}

Compiler output:
a.cc:1:9: 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;

int main(){
  string S;
  int K,N;
  cin >> N >> K >> S;
  if(S.at(K) = A){
    S.at(K) = a;
  }
  if(S.at(K) = B){
    S.at(K) = b;
  }
  else{
    S.at(K) = c;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'A' was not declared in this scope
    8 |   if(S.at(K) = A){
      |                ^
a.cc:9:15: error: 'a' was not declared in this scope
    9 |     S.at(K) = a;
      |               ^
a.cc:11:16: error: 'B' was not declared in this scope
   11 |   if(S.at(K) = B){
      |                ^
a.cc:12:15: error: 'b' was not declared in this scope
   12 |     S.at(K) = b;
      |               ^
a.cc:15:15: error: 'c' was not declared in this scope
   15 |     S.at(K) = c;
      |               ^
Language: C++

N,K = input().split()
S = list(input())

for i,j in enumerate(S):
	if i+1 == int(K):
		S[i] = j.lower()
print("".join(S))

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,K = input().split()
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'strtolower' was not declared in this scope; did you mean 'tolower'?
    8 |   strtolower(a[n-1]);
      |   ^~~~~~~~~~
      |   tolower
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll int64_t
int main
{
ll n,k;cin>>n>>k;
string s;cin>>s;
s[k-1]+=32;
cout<<s;

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main
      |     ^~~~
a.cc:6:4: error: expected primary-expression before 'n'
    6 | ll n,k;cin>>n>>k;
      |    ^
a.cc:6:4: error: expected '}' before 'n'
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
a.cc:6:8: error: 'cin' does not name a type
    6 | ll n,k;cin>>n>>k;
      |        ^~~
a.cc:7:10: error: 'cin' does not name a type
    7 | string s;cin>>s;
      |          ^~~
a.cc:8:1: error: 's' does not name a type
    8 | s[k-1]+=32;
      | ^
a.cc:9:1: error: 'cout' does not name a type
    9 | cout<<s;
      | ^~~~
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    if (N > K){continue;}
    else{break;}
    String S = sc.next();
    int i = 1;
    if (K == i) {
    	if (S == A){S = a;}
    	else {continue;}
    	if (S == B){S = b;}
    	else {continue;}
    	if (S == C){S = c;}
    	else {continue;}
    	;}
    else if (K > i) {i++;}
    else if (i == N){break;}
    else {break;}
    System.out.println();
  }
}

Compiler output:
Main.java:7: error: continue outside of loop
    if (N > K){continue;}
               ^
Main.java:8: error: break outside switch or loop
    else{break;}
         ^
Main.java:12: error: cannot find symbol
    	if (S == A){S = a;}
    	         ^
  symbol:   variable A
  location: class Main
Main.java:12: error: cannot find symbol
    	if (S == A){S = a;}
    	                ^
  symbol:   variable a
  location: class Main
Main.java:13: error: continue outside of loop
    	else {continue;}
    	      ^
Main.java:14: error: cannot find symbol
    	if (S == B){S = b;}
    	         ^
  symbol:   variable B
  location: class Main
Main.java:14: error: cannot find symbol
    	if (S == B){S = b;}
    	                ^
  symbol:   variable b
  location: class Main
Main.java:15: error: continue outside of loop
    	else {continue;}
    	      ^
Main.java:16: error: cannot find symbol
    	if (S == C){S = c;}
    	         ^
  symbol:   variable C
  location: class Main
Main.java:16: error: cannot find symbol
    	if (S == C){S = c;}
    	                ^
  symbol:   variable c
  location: class Main
Main.java:17: error: continue outside of loop
    	else {continue;}
    	      ^
Main.java:20: error: break outside switch or loop
    else if (i == N){break;}
                     ^
Main.java:21: error: break outside switch or loop
    else {break;}
          ^
13 errors
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    if (N > K){continue;}
    else{break;}
    String S = sc.next();
    int i = 1;
    if (K == i) {
    	if ( == A){ = a;}
    	else {continue;}
    	if ( == B){ = b;}
    	else {continue;}
    	if ( == C){ = c;}
    	else {continue;}
    	;}
    else if (K > i) {i++;}
    else if (i == N){break;}
    else {break;}
    System.out.println();
  }
}

Compiler output:
Main.java:12: error: illegal start of expression
    	if ( == A){ = a;}
    	     ^
Main.java:12: error: illegal start of expression
    	if ( == A){ = a;}
    	            ^
Main.java:14: error: illegal start of expression
    	if ( == B){ = b;}
    	     ^
Main.java:14: error: illegal start of expression
    	if ( == B){ = b;}
    	            ^
Main.java:16: error: illegal start of expression
    	if ( == C){ = c;}
    	     ^
Main.java:16: error: illegal start of expression
    	if ( == C){ = c;}
    	            ^
6 errors
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    String S = sc.next();
    int i = 1;
    if (K == i) {小文字にする;}
    else if (K > i) {i++;}
    else (i == N){終了;}
    System.out.println();
  }
}

Compiler output:
Main.java:9: error: not a statement
    if (K == i) {??????;}
                 ^
Main.java:11: error: not a statement
    else (i == N){??;}
         ^
Main.java:11: error: ';' expected
    else (i == N){??;}
                 ^
Main.java:11: error: not a statement
    else (i == N){??;}
                  ^
4 errors
Language: Java

import java util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner (System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    String S = sc.next();
    int i = 1;
    if (K == i) {小文字にする}
    else if (K > i) {i++;}
    else (i == N){終了}
    System.out.println();

Compiler output:
Main.java:1: error: '.' expected
import java util.*;
           ^
Main.java:9: error: not a statement
    if (K == i) {??????}
                 ^
Main.java:9: error: ';' expected
    if (K == i) {??????}
                       ^
Main.java:11: error: not a statement
    else (i == N){??}
         ^
Main.java:11: error: ';' expected
    else (i == N){??}
                 ^
Main.java:11: error: not a statement
    else (i == N){??}
                  ^
Main.java:11: error: ';' expected
    else (i == N){??}
                    ^
Main.java:12: error: reached end of file while parsing
    System.out.println();
                         ^
8 errors
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n,k;
  cin >> n >> k;
  char[] s[n+1];
  cin >> s;
  switch s[k-1]{
    case 'A': s[k-1] = 'a';
    case 'B': s[k-1] = 'b';
    case 'C': s[k-1] = 'c';
  }
  cout s;
  return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: structured binding declaration cannot have type 'char'
    6 |   char[] s[n+1];
      |       ^~
a.cc:6:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:7: error: empty structured binding declaration
a.cc:6:10: error: expected initializer before 's'
    6 |   char[] s[n+1];
      |          ^
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:8:10: error: expected '(' before 's'
    8 |   switch s[k-1]{
      |          ^
      |          (
a.cc:13:7: error: expected ';' before 's'
   13 |   cout s;
      |       ^~
      |       ;
Language: Java

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        
        int N;
        int K;
        
        N = N - 1;
        
        String S[N];
        
        int count;
        String small;
        
        for(count=0 ; count == K ; count++){
            if(count == K-1){
                small= S[count];
                small = small.toUpperCase();
                S[count] = small;
            }
            break;
        }
        
        System.out.println(S);
        
    }
}

Compiler output:
Main.java:10: error: ']' expected
        String S[N];
                 ^
Main.java:10: error: ';' expected
        String S[N];
                  ^
2 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int k = scan.nextInt();
    String s = scan.next();
    System.out.println(s.subString(0, k - 1) + s.subString(k - 1, k - 1).toLowerCase() + s.subString(k));
  }
}

Compiler output:
Main.java:9: error: cannot find symbol
    System.out.println(s.subString(0, k - 1) + s.subString(k - 1, k - 1).toLowerCase() + s.subString(k));
                        ^
  symbol:   method subString(int,int)
  location: variable s of type String
Main.java:9: error: cannot find symbol
    System.out.println(s.subString(0, k - 1) + s.subString(k - 1, k - 1).toLowerCase() + s.subString(k));
                                                ^
  symbol:   method subString(int,int)
  location: variable s of type String
Main.java:9: error: cannot find symbol
    System.out.println(s.subString(0, k - 1) + s.subString(k - 1, k - 1).toLowerCase() + s.subString(k));
                                                                                          ^
  symbol:   method subString(int)
  location: variable s of type String
3 errors
Language: Java

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

public class DiceAndCoin {
	public static void main(String[] args) {
		try {
			String[] input = new BufferedReader(new InputStreamReader(System.in)).readLine().split(" ");
			int faces = Integer.parseInt(input[0]);
			int target = Integer.parseInt(input[1]);
			double rate = 0;
			for (int i = 1; i <= faces; i++) {
				int cnt = 0;
				int sum = i;
				while(sum < target) {
					sum += sum;
					cnt++;
				}
				rate += Math.pow(0.5, cnt) / faces;
			}
			System.out.println(rate);
		} catch (IOException e1) {
		}
	}
}


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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String line = sc.nextLine();
    String[] spl = str.split("");
    spl[k-1].toLowerCase();
    line = "";
    for(int i = 0; i < n; i++){
      line += spl[i];
    }
    System.out.println(line);
  }
}

Compiler output:
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
    String[] spl = str.split("");
                   ^
  symbol:   variable str
  location: class Main
3 errors
Language: Java

Public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String line = sc.nextLine();
    String[] spl = str.split("");
    spl[k-1].toLowerCase();
    line = "";
    for(int i = 0; i < n; i++){
      line += spl[i];
    }
    System.out.println(line);
  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
Public class Main{
^
1 error
Language: C++

#include<iostream>
#include<string>
using namespace std;
 
int main(){
  int N, K;
  string S;
  cin >> N >> K;
  cin >> S;
  if(S[K-1} == 'A'){
    S[K-1] = 'a';
  }
   else if(S[K-1] == 'B'){
     S[K-1] = 'b';
   }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected ']' before '}' token
   10 |   if(S[K-1} == 'A'){
      |           ^
      |           ]
a.cc:10:11: error: expected ')' before '}' token
   10 |   if(S[K-1} == 'A'){
      |     ~     ^
      |           )
a.cc:10:11: error: expected primary-expression before '}' token
a.cc: At global scope:
a.cc:10:13: error: expected unqualified-id before '==' token
   10 |   if(S[K-1} == 'A'){
      |             ^~
a.cc:13:4: error: expected unqualified-id before 'else'
   13 |    else if(S[K-1] == 'B'){
      |    ^~~~
Language: C++

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

int main(){
  int N, K;
  string S;
  cin >> N >> K;
  cin >> S;
  if(S[K-1} == 'A'){
    S[K-1] = 'a';
  }
   else if(S[K-1] == 'B'){
     S[K-1] = 'b';
   }
   else{
     S[K-1] = 'c';
   }
   cout << S << endl;
       return 0;
       }

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N >> K;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<string>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:10:11: error: expected ']' before '}' token
   10 |   if(S[K-1} == 'A'){
      |           ^
      |           ]
a.cc:10:11: error: expected ')' before '}' token
   10 |   if(S[K-1} == 'A'){
      |     ~     ^
      |           )
a.cc:10:11: error: expected primary-expression before '}' token
a.cc: At global scope:
a.cc:10:13: error: expected unqualified-id before '==' token
   10 |   if(S[K-1} == 'A'){
      |             ^~
a.cc:13:4: error: expected unqualified-id before 'else'
   13 |    else if(S[K-1] == 'B'){
      |    ^~~~
a.cc:16:4: error: expected unqualified-id before 'else'
   16 |    else{
      |    ^~~~
a.cc:19:4: error: 'cout' does not name a type
   19 |    cout << S << endl;
      |    ^~~~
a.cc:20:8: error: expected unqualified-id before 'return'
   20 |        return 0;
      |        ^~~~~~
a.cc:21:8: error: expected declaration before '}' token
   21 |        }
      |        ^
Language: C++

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

using namespace std;

int main()
{
	int N, K;
	string str;
	cin >> N >> K;
	cin >> str;
	str[K] += 32;
	cout << str;
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void)
{
  int N, K;
  string S;
  
  cin >> N >> K;
  cin >> S;
  
  if(S[K+1]=='A')
    S[K+1] = 'a'
  else if(S[K+1]=='B')
    S[K+1] = 'b';
  else
    S[K+1] = 'c'
    
   cout << S;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected ';' before 'else'
   15 |     S[K+1] = 'a'
      |                 ^
      |                 ;
   16 |   else if(S[K+1]=='B')
      |   ~~~~           
a.cc:19:17: error: expected ';' before 'cout'
   19 |     S[K+1] = 'c'
      |                 ^
      |                 ;
   20 | 
   21 |    cout << S;
      |    ~~~~
Language: Java

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

public class ChangeChracter {
	
  public static void main(String[] args) {
	  int n,k;
	  char[] ch;
	  String line;
    try {
      BufferedReader stdin =
        new BufferedReader(new InputStreamReader(System.in));
      
      n = stdin.read();
      k = stdin.read();
      line = stdin.readLine();
      
      
      ch = new char[line.length()];
      for(int i = 0; i < line.length(); i++) {
    	  ch[i] = line.charAt(i);
      }
      
      switch(ch[k-1]) {
      case 'A':
    	  ch[k-1] = 'a';
    	  break;
      case 'B':
    	  ch[k-1] = 'b';
    	  break;
      case 'C':
    	  ch[k-1] = 'c';
    	  break;
      }
      
      String s = new String(ch);
      System.out.println(s);
      
      stdin.close();
      System.out.println("\nPROGRAM END");
    } catch (Exception e) {
      e.getStackTrace();
      System.exit(-1); // プログラムを終了
    }
  }
}

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

#include<bits/stdc++.h>
using namespace std;
vector<int> tree; 
int root(int x){
  if (tree[x]==x){
    return x;
  }
  if (tree[x] != x){
    return tree[x] = root(tree[x]);
  }
}
int main(){
  int n,m;
  cin >>n>>m;
  int z;
  vector <int> tree(n);
  for (int i=0; i<n; i++){
    tree[i]=i;
  }
  vector<int> x(m);
  vector<int> y(m);
  int rx,ry;
  for (int i=0; i<m; i++){
    cin >> x[i] >> y[i] >> z;
    x[i]--;
    y[i]--;
    rx=root(x[i],tree);
    ry=root(y[i],tree);
    if(rx != ry){
      tree[rx] = ry;
    }
  }
  int count=0;
  for (int i=0; i<n; i++){
    if (tree[i]==i){
      count++;
    }
  }
  cout << count << endl;
}
   
   


Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: too many arguments to function 'int root(int)'
   27 |     rx=root(x[i],tree);
      |        ~~~~^~~~~~~~~~~
a.cc:4:5: note: declared here
    4 | int root(int x){
      |     ^~~~
a.cc:28:12: error: too many arguments to function 'int root(int)'
   28 |     ry=root(y[i],tree);
      |        ~~~~^~~~~~~~~~~
a.cc:4:5: note: declared here
    4 | int root(int x){
      |     ^~~~
a.cc: In function 'int root(int)':
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^