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

#include <iostream>
 int main() {
   int N;
   int ans = 0;
   int a = 0;
   std::cin >> N;
     for (int i = 0; i == N; i++;) {
       a++;
       std::base ans += a;
       N--;
   }
    std::cout << ans <<std::endl;
   
   
   return 0;
   
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: expected ')' before ';' token
    7 |      for (int i = 0; i == N; i++;) {
      |          ~                      ^
      |                                 )
a.cc:7:34: error: expected primary-expression before ')' token
    7 |      for (int i = 0; i == N; i++;) {
      |                                  ^
Language: C++

#include <iostream>
 int main() {
   int N;
   int ans = 0;
   int a = 0;
   std::cin >> N;
     for (int i = 0; i == N; i++;) {
       a++;
       base ans += a;
       N--;
   }
    std::cout << ans <<std::endl;
   
   
   return 0;
   
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: expected ')' before ';' token
    7 |      for (int i = 0; i == N; i++;) {
      |          ~                      ^
      |                                 )
a.cc:7:34: error: expected primary-expression before ')' token
    7 |      for (int i = 0; i == N; i++;) {
      |                                  ^
Language: C++

#include <iostream>
 int main() {
   int N;
   int ans = 0;
   std::cin >> N;
     for (int i = 0; i == N; i++) {
     ans += i;
   }
    std::cout << ans <<std::endl;
   }
   
   
   
   return 0;
   
 }

Compiler output:
a.cc:14:4: error: expected unqualified-id before 'return'
   14 |    return 0;
      |    ^~~~~~
a.cc:16:2: error: expected declaration before '}' token
   16 |  }
      |  ^
Language: C++

#include <iostream>
 int main() {
   int N;
   int ans = 0;
   std::cin >> N;
   for (int i = 0; i == N; i++) {
     ans += i;
   }
    std::cout << ans <,std::endl;
   
   
   
   
   return 0;
   
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ',' token
    9 |     std::cout << ans <,std::endl;
      |                       ^
Language: C++

#include <iostream>
 int main() {
   int N, ans;
   std::cin >> N;
   for (int i = 1; i > N; i++) {
     ans += i;
   }
    std::cout << ans <,std::endl;
   
   
   
   
   return 0;
   
 }
     

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: expected primary-expression before ',' token
    8 |     std::cout << ans <,std::endl;
      |                       ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  cout << (1 + n) * n / 2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'n' was not declared in this scope
    7 |   cout << (1 + n) * n / 2 << endl;
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int a, b = 0, i;
	for (i == 1;i <= a;i++){
		b += i
	}
	cout << b << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before '}' token
    7 |                 b += i
      |                       ^
      |                       ;
    8 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

//#define MD 100010

int main(){
    int n;
    cin>>n;
    long int ans=O;
    for(int i=1;i<=n;i++){
        ans+=i;
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'O' was not declared in this scope
   10 |     long int ans=O;
      |                  ^
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
	int i,p;
	char sd[20];
	char f[20];
	char e[20];
	scanf("%s",sd);
	p = strlen(sd);
	for (i = 0;i < p; i++) {
		if (sd[i] == '0') {
			strcat(f, "0");
		}
		if (sd[i] == '1') {
			strcat(f, "1");
		}
		if (sd[i] == 'B' && strlen(f) - 1 >= 0 {
		    strncpy(e, f, (int)(strlen(f) - 1));
			strcpy(f, e);
 
		}
	}
	printf("%s\n", f);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:55: error: expected ')' before '{' token
   17 |                 if (sd[i] == 'B' && strlen(f) - 1 >= 0 {
      |                    ~                                  ^~
      |                                                       )
main.c:22:9: error: expected expression before '}' token
   22 |         }
      |         ^
Language: Java

import java.util.Scanner;
public class Main043{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int sum = 0;
        for(int i = 1;i <= num;i++){
            sum = sum + i;
        }
        System.out.println(sum);
    }
}


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

#include<iostream>
using namespace std;
int main(){
  int n,
  cin >> n;
  int ans = 0;
  for(int i = 1; i <= n; i++){
    ans += i;
  }
  cout << ans << endl;
}
    

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

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int sum=0;
  for(int i=1;i<=K;i++)sum+=i;
  cout<<sum<<endl;
    
}

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

int main(){

    int n;
    std::cin >> n;

    std::cout << ((n + 1) * n) / 2 << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
    4 |     std::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 | int main(){
a.cc:6:10: error: 'cout' is not a member of 'std'
    6 |     std::cout << ((n + 1) * n) / 2 << std::endl;
      |          ^~~~
a.cc:6:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:44: error: 'endl' is not a member of 'std'
    6 |     std::cout << ((n + 1) * n) / 2 << std::endl;
      |                                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(){
Language: C++

process.stdin.resume();
process.stdin.setEncoding('ascii');

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

process.stdin.on('data', function (data) {
    input_stdin += data;
});

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

/////////////// ignore above this line ////////////////////

function hacking(s) {
    var ret="";
    for (var i=0; i < s.length; i++){
        if (s[i] == '0'){
            ret += '0';
        } else if (s[i] == '1'){
            ret += '1';
        } else if (s[i] == 'B' && ret.length > 0){
            ret = ret.substr(0, ret.length-1);
        }
    }
    return ret;
}

function main() {
    //var l = parseInt(readLine());
    var s = readLine();
    var result = hacking(s);
    process.stdout.write("" + result + "\n");
}


Compiler output:
a.cc:2:27: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    2 | process.stdin.setEncoding('ascii');
      |                           ^~~~~~~
a.cc:8:18: warning: multi-character character constant [-Wmultichar]
    8 | process.stdin.on('data', function (data) {
      |                  ^~~~~~
a.cc:12:18: warning: multi-character character constant [-Wmultichar]
   12 | process.stdin.on('end', function () {
      |                  ^~~~~
a.cc:1:1: error: 'process' does not name a type
    1 | process.stdin.resume();
      | ^~~~~~~
a.cc:2:1: error: 'process' does not name a type
    2 | process.stdin.setEncoding('ascii');
      | ^~~~~~~
a.cc:4:1: error: 'var' does not name a type
    4 | var input_stdin = "";
      | ^~~
a.cc:5:1: error: 'var' does not name a type
    5 | var input_stdin_array = "";
      | ^~~
a.cc:6:1: error: 'var' does not name a type
    6 | var input_currentline = 0;
      | ^~~
a.cc:8:1: error: 'process' does not name a type
    8 | process.stdin.on('data', function (data) {
      | ^~~~~~~
a.cc:10:2: error: expected unqualified-id before ')' token
   10 | });
      |  ^
a.cc:12:1: error: 'process' does not name a type
   12 | process.stdin.on('end', function () {
      | ^~~~~~~
a.cc:15:2: error: expected unqualified-id before ')' token
   15 | });
      |  ^
a.cc:17:1: error: 'function' does not name a type; did you mean 'union'?
   17 | function readLine() {
      | ^~~~~~~~
      | union
a.cc:23:1: error: 'function' does not name a type; did you mean 'union'?
   23 | function hacking(s) {
      | ^~~~~~~~
      | union
a.cc:37:1: error: 'function' does not name a type; did you mean 'union'?
   37 | function main() {
      | ^~~~~~~~
      | union
Language: Java

import java.util.Scanner;

class Candy {
 public static void main(String[] args) {
     scanner scan = new Scanner(System.in);
     int n = scan.nextInt();
     int sum = 0;
     for(int i = 0; i < n; i++) {
          sum += (i + 1);
     }
     System.out.println(sum);
   }
}

Compiler output:
Main.java:5: error: cannot find symbol
     scanner scan = new Scanner(System.in);
     ^
  symbol:   class scanner
  location: class Candy
1 error
Language: Java

import java.util.Scanner;

class Candy {


}





Copy
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
      System.out.println((n+1) * n/2);
  }
}

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

#include <iostream>
using namespace std;

int main(){
  int N,Sum;
  cin >> N;
  for (int j == 1; j <= N ; j++){
    Sum += j;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before '==' token
    7 |   for (int j == 1; j <= N ; j++){
      |             ^~~
      |             ;
a.cc:7:14: error: expected primary-expression before '==' token
    7 |   for (int j == 1; j <= N ; j++){
      |              ^~
a.cc:7:26: error: expected ')' before ';' token
    7 |   for (int j == 1; j <= N ; j++){
      |       ~                  ^~
      |                          )
a.cc:7:29: error: 'j' was not declared in this scope
    7 |   for (int j == 1; j <= N ; j++){
      |                             ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N,Sum;
  cin >> N;
  for (int j == 1; j <= N ; j++){
    Sum += j
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before '==' token
    7 |   for (int j == 1; j <= N ; j++){
      |             ^~~
      |             ;
a.cc:7:14: error: expected primary-expression before '==' token
    7 |   for (int j == 1; j <= N ; j++){
      |              ^~
a.cc:7:26: error: expected ')' before ';' token
    7 |   for (int j == 1; j <= N ; j++){
      |       ~                  ^~
      |                          )
a.cc:7:29: error: 'j' was not declared in this scope
    7 |   for (int j == 1; j <= N ; j++){
      |                             ^
Language: C++

// g++ macro.cpp -std=c++14
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;//namespace

#define dump(x)  cout << #x << " = " << (x) << endl;// debug cout
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define CIN(x) int x;cin>>x;

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_;
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl;

#define ALL(obj) (obj).begin(),(obj).end()// iterator

#define P pair<int,int>
#define V vector<int>

#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair


int main(){

    CIN(n);
    int sum=0;
    REP(i,n+1);sum+=i;
    cout<<sum<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'i' was not declared in this scope
   35 |     REP(i,n+1);sum+=i;
      |                     ^
Language: C

#include<stdio.h>
int main(){
  int n, i;
  int sum = 0;
  scanf("%d", &n);
  for(i = 0; i < = n; i++){
    sum += i;
  }
  printf("%d\n", sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:18: error: expected expression before '=' token
    6 |   for(i = 0; i < = n; i++){
      |                  ^
Language: Java

import java.util.*;

public static void main (String argv[]){
Scanner input=new Scanner (System.in);
int n=input.nextInt();
int sum=0;
for (int i=0;i++<n;)
    sum+=i;
System.out.print(sum);
}


Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main (String argv[]){
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.*;
public class b043 {
public static void main (String argv[]){
Scanner input=new Scanner (System.in);
int n=input.nextInt();
int sum=0;
for (int i=0;i++<n;)
    sum+=i;
System.out.print(sum);
}
}

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

import java.util.*;
public class  {
public static void main (String argv[]){
Scanner input=new Scanner (System.in);
int n=input.nextInt();
int sum=0;
for (int i=0;i++<n;)
    sum+=i;
System.out.print(sum);
}
}

Compiler output:
Main.java:2: error: <identifier> expected
public class  {
            ^
1 error
Language: C++

# -*- coding: utf-8 -*-
import math
import sys
import itertools
import numpy as np
import functools
import collections
mo = 1000000007
INF = 10**100
r = range

class infix(object):
    def __init__(self, function):
        self.function = function

    def __ror__(self, other):
        self.left = other
        return self

    def __or__(self, other):
        return self.function(self.left, other)

    def __call__(self, value1, value2):
        return self.function(value1, value2)

@infix
def c(f_t_u, f_u_r): return lambda t: f_u_r(f_t_u(t))

class _Ap(object):
    def __rlshift__(self, other):
        self.value = other
        return self

    def __rshift__(self, other):
        return other(self.value)
Ap = _Ap()
ap = Ap

#d = {1:2, 3:5, 6:10, 1000043:3814}
#zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)



n = int(input())
print(n*(n+1)//2)



Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:26:1: error: stray '@' in program
   26 | @infix
      | ^
a.cc:39:2: error: invalid preprocessing directive #d
   39 | #d = {1:2, 3:5, 6:10, 1000043:3814}
      |  ^
a.cc:40:2: error: invalid preprocessing directive #zip
   40 | #zip(d.keys(), d.values())<<ap>>(list |c| sorted |c| reversed |c| list |c| print)
      |  ^~~
a.cc:2:1: error: 'import' does not name a type
    2 | import math
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;
int main(){
	int a;
	cin>>a;
	cout<<n*(n+1)/2<<endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'n' was not declared in this scope
    6 |         cout<<n*(n+1)/2<<endl;
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
int a,j,sm=0;cin>>a;for(j=0;j<=aa;j++)sm+=j;cout<<sm;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:32: error: 'aa' was not declared in this scope; did you mean 'a'?
    5 | int a,j,sm=0;cin>>a;for(j=0;j<=aa;j++)sm+=j;cout<<sm;
      |                                ^~
      |                                a
Language: C++

#include <bits/stdc++.h>
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
using namespace std;

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;
 
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
cin >> n;
cout << n*(n+1)/2 <<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:8: error: 'n' was not declared in this scope; did you mean 'yn'?
   26 | cin >> n;
      |        ^
      |        yn
Language: C++

include<bits/stdc++.h>

using namespace std;

int main(){
        int N;
        cin>>N;
        int res=0;
        for(int i=1;i<=N;i++){
                res+=i;
        }
        cout<<res<<endl;
        return 0;
}


Compiler output:
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:9: error: 'cin' was not declared in this scope
    7 |         cin>>N;
      |         ^~~
a.cc:12:9: error: 'cout' was not declared in this scope
   12 |         cout<<res<<endl;
      |         ^~~~
a.cc:12:20: error: 'endl' was not declared in this scope
   12 |         cout<<res<<endl;
      |                    ^~~~
Language: C++

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

int main{
 int n;
 cin>>n;
 cout<<(n*n+n)/2<<endl;
}


Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:2: error: expected primary-expression before 'int'
    6 |  int n;
      |  ^~~
a.cc:6:2: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:7:2: error: 'cin' does not name a type
    7 |  cin>>n;
      |  ^~~
a.cc:8:2: error: 'cout' does not name a type
    8 |  cout<<(n*n+n)/2<<endl;
      |  ^~~~
a.cc:9:1: error: expected declaration before '}' token
    9 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
cin>>n;
cout<<(n+1)*n/2<<endl;
}

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

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <utility>

using namespace std;

int main() {
  int a;
  cin >> a;
  cout << 1 / 2 * (a + 1) * a << endl;

  return 0;
}
　

Compiler output:
a.cc:17:1: error: extended character 　 is not valid in an identifier
   17 | 　
      | ^
a.cc:17:1: error: '\U00003000' does not name a type
   17 | 　
      | ^~
Language: C

from collections import defaultdict


def main():
    print(sum([i for i in range(1, int(input()) + 1)]))


if __name__ == '__main__':
    main()


Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from collections import defaultdict
      | ^~~~
main.c:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from collections import defaultdict
      |                  ^~~~~~
main.c:1:18: error: unknown type name 'import'
main.c:8:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    8 | if __name__ == '__main__':
      |                ^~~~~~~~~~
Language: C++

int main() {
	int N;
	cin >> N;
	int S = 0;
	for (int i = 1; i <= N; i++) {
		S += i;
	}
	cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N;
      |         ^~~
a.cc:8:9: error: 'cout' was not declared in this scope
    8 |         cout << S << endl;
      |         ^~~~
a.cc:8:22: error: 'endl' was not declared in this scope
    8 |         cout << S << endl;
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin>>n;
    cout<<n(1+n)/2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'n' cannot be used as a function
    6 |     cout<<n(1+n)/2<<endl;
      |           ~^~~~~
Language: C++


#include <stdio.h>

void main(void){

	int in = 0;
	scanf("%d",&in);


	int i = 0, count=0;
	for(i=0; i<in; i++){
		count += i+1;
	}


	printf("%d\n",count);

	return;
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main(void){
      | ^~~~
a.cc: In function 'int main()':
a.cc:18:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   18 |         return;
      |         ^~~~~~
Language: C


#include <stdio.h>

int main(void){

	int in;
	scanf("%d", &in);


	int i, count;
	for(i=0; i<in; i<10){
		count += i
	}


	printf("%d\n",count);

	return 1;
}

Compiler output:
main.c: In function 'main':
main.c:12:27: error: expected ';' before '}' token
   12 |                 count += i
      |                           ^
      |                           ;
   13 |         }
      |         ~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <list>
#include <set>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define INF 1010101010
#define MOD 1000000007
#define LL long long
using Coord = pair<int, int>;

int main() {
    int n;
    cin >> n;

    cout << (n + 1) * n / 2 << endl;`
}

Compiler output:
a.cc:23:37: error: stray '`' in program
   23 |     cout << (n + 1) * n / 2 << endl;`
      |                                     ^
Language: C++

  import java.util.*;
  public class Main {
     
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    		String s=sc.next();
    		String m="";
    		String taihi="";
    		for(int i=0;i<s.length();i++){
    			if(s.charAt(i)=='B'){
    				for(int j=0;j<m.length()-1;j++){
    					taihi+=m.charAt(j);
    				}
    				m=taihi;
    				taihi="";
    			}else{
    				m+=s.charAt(i);
    }
    }
    		System.out.println(m);
    }
    }

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

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
	int n,sum =0;
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int i = 1; i <= n; i++){
		sum += i;
		}
		System.out.println(sum);
		}
		}

Compiler output:
Main.java:6: error: variable sc is already defined in method main(String[])
		Scanner sc = new Scanner(System.in);
		        ^
1 error
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
	int n,sum =0;
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		for(int i = 1; i <= n; i++){
		sum += i;
		}
		System.out.println(sum);

Compiler output:
Main.java:11: error: reached end of file while parsing
		System.out.println(sum);
		                        ^
1 error
Language: Java

import java.util.Scanner;

public class main {
	private static Scanner sc;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		int N =sc.nextInt();
		int z=0;
		for(int i =0;i<=N;i++){
			z=z+i;
		}
		System.out.println(z);
	}

}


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

package rimo;

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

public class Atcoder {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int sum = 0, i;
		for (i = 1; i <= N; i++) {
			sum += i;
		}
		System.out.println(sum);
	}
}


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

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

int main(){
  int N,cand;
  cin>>N;
  rep(i,N){
    cand*=cand-1;
  }
  cout<<cand;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i,N){
      |       ^
a.cc:3:22: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(i=0; i<n; i++)
      |                      ^
Language: C++

using System;
 
public class Test
{
	public static void Main()
	{
		int a = int.Parse(Console.ReadLine());
		Console.WriteLine((a * (a+1))/2);
	}
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Test
      | ^~~~~~
Language: C++

import java.util.Scanner;


class Hello{
    public static void main(String args[]){
	//	print();
	int x ;
	Scanner scan = new Scanner(System.in);

	x = scan.nextInt();

	if(x>100){
	    return;
	}

	int sum = 0;
	for(int n=1;1 <= n &&n <= x;n++){
	    sum = sum + n;
	}
	System.out.println(sum);

    }
    static void print(){
	System.out.println("hello world");
	return;
    }
}//1からnまで足す

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:5:11: error: expected ':' before 'static'
    5 |     public static void main(String args[]){
      |           ^~~~~~~
      |           :
a.cc:5:29: error: 'String' has not been declared
    5 |     public static void main(String args[]){
      |                             ^~~~~~
a.cc:27:2: error: expected ';' after class definition
   27 | }//1からnまで足す
      |  ^
      |  ;
a.cc: In static member function 'static void Hello::main(int*)':
a.cc:8:9: error: 'Scanner' was not declared in this scope
    8 |         Scanner scan = new Scanner(System.in);
      |         ^~~~~~~
a.cc:10:13: error: 'scan' was not declared in this scope
   10 |         x = scan.nextInt();
      |             ^~~~
a.cc:20:9: error: 'System' was not declared in this scope
   20 |         System.out.println(sum);
      |         ^~~~~~
a.cc: In static member function 'static void Hello::print()':
a.cc:24:9: error: 'System' was not declared in this scope
   24 |         System.out.println("hello world");
      |         ^~~~~~
Language: C++

def main():
    n = int(input())
    print(sum(i for i in range(1, n + 1)))


if __name__ == '__main__':
    main()


Compiler output:
a.cc:6:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    6 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def main():
      | ^~~
Language: C++


int array_sum(int* array, const int size) {
        int result = 0;
        for (int i = 0; i < size; i++) {
                result += *(array + i);
        }
        return result;
}

int main() {
        int N = 0;
        scanf("%d", &N);
        int a[N];
        double b_dbl = 0.0;
        int b = 0;
        int result = 0;
        for (int i= 0; i < N; i++) {
                scanf("%d", a + i);
        }
        b_dbl = array_sum(a, N) / N;
        b = int(b_dbl + 0.5);
        for (int i = 0; i < N; i++) {
                result += (*(a + i) - b) * (*(a + i) - b);
        }
        printf("%d\n", result);
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf' was not declared in this scope
   12 |         scanf("%d", &N);
      |         ^~~~~
a.cc:25:9: error: 'printf' was not declared in this scope
   25 |         printf("%d\n", result);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 |
Language: C++

#include<iostream>
using namespace std;
int main()
{
　　int a;
　　cin>>a;
　　cout<<a*(a+1)/2<<endl;
　　return 0;
}

Compiler output:
a.cc:5:1: error: extended character 　 is not valid in an identifier
    5 | 　　int a;
      | ^
a.cc:5:1: error: extended character 　 is not valid in an identifier
a.cc:6:1: error: extended character 　 is not valid in an identifier
    6 | 　　cin>>a;
      | ^
a.cc:6:1: error: extended character 　 is not valid in an identifier
a.cc:7:1: error: extended character 　 is not valid in an identifier
    7 | 　　cout<<a*(a+1)/2<<endl;
      | ^
a.cc:7:1: error: extended character 　 is not valid in an identifier
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　　return 0;
      | ^
a.cc:8:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:5:1: error: '\U00003000\U00003000int' was not declared in this scope
    5 | 　　int a;
      | ^~~~~~~
a.cc:6:1: error: '\U00003000\U00003000cin' was not declared in this scope
    6 | 　　cin>>a;
      | ^~~~~~~
a.cc:6:10: error: 'a' was not declared in this scope
    6 | 　　cin>>a;
      |          ^
a.cc:7:1: error: '\U00003000\U00003000cout' was not declared in this scope
    7 | 　　cout<<a*(a+1)/2<<endl;
      | ^~~~~~~~
a.cc:8:1: error: '\U00003000\U00003000return' was not declared in this scope
    8 | 　　return 0;
      | ^~~~~~~~~~
Language: C++

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

public class Main {
    public static void main(String[] args) throws java.io.IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String l = in.readLine();
        int N = Integer.parseInt(l);//5
        int candy = 0;
    for (int i=0; i-1<N; i++){
         candy = candy +i ;
        
   }
      System.out.println(candy); 
   }
   
  }

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

N = int(input())
i = 1
answer = 0
while  i <= N:
	answer += i
	i += 1

print(answer) 

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | N = int(input())
      |     ^~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
const long long INF = LLONG_MAX / 2;
#define FOR(i, r, n) for(int i=(r); i<(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ll long long int
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
	vector.erase(vector.begin() + index);
}

using namespace std;
ll ans = 0, sum = 0, n, k, t;
string s;

map<ll, ll> m;

int main() {
	cin >> n;
	cout << n*(n + 1) / 2 << endl;
}

Compiler output:
a.cc:7:23: error: 'LLONG_MAX' was not declared in this scope
    7 | const long long INF = LLONG_MAX / 2;
      |                       ^~~~~~~~~
a.cc:7:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <vector>
  +++ |+#include <climits>
    7 | const long long INF = LLONG_MAX / 2;
Language: C

#include<stdio.h>
int main(void){
  int num;
  scanf("%d"&num);
  printf("%d",num*(num+1)%2);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: invalid operands to binary & (have 'char *' and 'int')
    4 |   scanf("%d"&num);
      |         ~~~~^
      |         |
      |         char *
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	string s;
	cin >> s;
	vector<char> ans;
	for(int unsigned i=0;i<s.size();i++){
		if(s[i] == 'B'){
			ans.size() && ans.pop_back();
			continue;
		}
		ans.emplace_back(s[i]);
	}
	for(int unsigned i=0;i<ans.size();i++){
		cout << ans[i];
	}
	cout << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:51: error: could not convert 'ans.std::vector<char>::pop_back()' from 'void' to 'bool'
   11 |                         ans.size() && ans.pop_back();
      |                                       ~~~~~~~~~~~~^~
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		solve(s);
		s.close();
	}

	public static void solve(Scanner s) {
		int n = s.nextInt();

		long ans = 0;

		for (int i = 0; i < n; i++) {
			ans += i + 1;
		}

		System.out.println(ans);
	}
}


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++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		solve(s);
		s.close();
	}

	public static void solve(Scanner s) {
		int n = s.nextInt();
		
		long ans = 0;
		
		for(int i=0; i<n; i++){
			ans += i;
		}
		
		System.out.println(ans);
	}
}


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 <iostream>

int main() {
  int n;
  cin >> n;
  cout << n(n-1)/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   cout << n(n-1)/2 << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:12: error: 'n' cannot be used as a function
    6 |   cout << n(n-1)/2 << endl;
      |           ~^~~~~
a.cc:6:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   cout << n(n-1)/2 << endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

typedef long long ll;
int main(){
  ll a
  cin>>a;
  if(a%2==0)cout<<(a/2)*(a+1)<<endl;
  else cout<<a*(a+1)/2<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'cin'
    8 |   cin>>a;
      |   ^~~
a.cc:9:6: error: 'a' was not declared in this scope
    9 |   if(a%2==0)cout<<(a/2)*(a+1)<<endl;
      |      ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char const *argv[])
{
	int N;
	cin >> N;

	int res = (N*(N+1))/2

	cout << res << endl;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:13:9: error: expected ',' or ';' before 'cout'
   13 |         cout << res << endl;
      |         ^~~~
Language: C

    #include<stdio.h>
     
    int main(void)
     {
        int N,i,sum=0;
        scanf("%d",&N);
        for(i=1;i<=N;i++)
          {
            sum=sum+i;
          }
       printf("%d",sum);
       rewind(stdin)
       getchar();
       return 0;
     }

Compiler output:
main.c: In function 'main':
main.c:12:21: error: expected ';' before 'getchar'
   12 |        rewind(stdin)
      |                     ^
      |                     ;
   13 |        getchar();
      |        ~~~~~~~
Language: C

#include<stdio.h>

int main(void)
 {
    int N,i,sum=0;
    scanf("%d",&N);
    for(i=1;i<=N;i++)
      {
        sum=sum+i;
      }
   printf("%d",sum);
   rewind(stdin)
   getchar ();
   return0;
 }

Compiler output:
main.c: In function 'main':
main.c:12:17: error: expected ';' before 'getchar'
   12 |    rewind(stdin)
      |                 ^
      |                 ;
   13 |    getchar ();
      |    ~~~~~~~       
main.c:14:4: error: 'return0' undeclared (first use in this function)
   14 |    return0;
      |    ^~~~~~~
main.c:14:4: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N;
	cin >> N;
	cout << N*(n+1)/2 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'n' was not declared in this scope
    7 |         cout << N*(n+1)/2 << endl;
      |                    ^
Language: Java

import java.util.*;
public class A043{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
		// スペース区切りの整数の入力
		int sum=0;
for(int i=1;i<=N;i++){
	sum=sum+i;
}
		// 出力
		System.out.println(sum);
	}
}

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

int a,s;
a=10;
for 1:1:10
 s=s+1;
end



Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | a=10;
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:3:1: error: expected identifier or '(' before 'for'
    3 | for 1:1:10
      | ^~~
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
    5 | end
      | ^~~
Language: Java

package coder;
import java.util.Scanner;
public class Coder {
    public static void main(String[] args) {
        // TODO code application logic here
        int result = 0;
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for(int i = 1 ; i <= input ; i ++){
            result += i;
        }
        System.out.print(result);
    }
}


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

class Coder {

    public static void main(String[] args) {
       
        int result = 0;
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for(int i = 1 ; i <= input ; i ++){
            result += i;
        }
        System.out.print(result);
    }
    
}

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

int result = 0;
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for(int i = 1 ; i <= input ; i ++){
            result += i;
        }
        System.out.print(result);

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
int result = 0;
^
  (use --enable-preview to enable unnamed classes)
Main.java:4: error: class, interface, enum, or record expected
        for(int i = 1 ; i <= input ; i ++){
        ^
Main.java:4: error: class, interface, enum, or record expected
        for(int i = 1 ; i <= input ; i ++){
                        ^
Main.java:4: error: class, interface, enum, or record expected
        for(int i = 1 ; i <= input ; i ++){
                                     ^
Main.java:6: error: class, interface, enum, or record expected
        }
        ^
5 errors
Language: Java


package coder;

import java.util.Scanner;

    public static void main(String[] args) {
        // TODO code application logic here
        int result = 0;
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for(int i = 1 ; i <= input ; i ++){
            result += i;
        }
        System.out.print(result);


Compiler output:
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args) {
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:14: error: reached end of file while parsing
        System.out.print(result);
                                 ^
Main.java:2: error: unnamed class should not have package declaration
package coder;
^
3 errors
Language: Java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package coder;

import java.util.Scanner;

/**
 *
 * @author thanhtuan
 */
public class Coder {

    public static void main(String[] args) {
        // TODO code application logic here
        int result = 0;
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for(int i = 1 ; i <= input ; i ++){
            result += i;
        }
        System.out.print(result);
    }
    
}


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

import java.util.Scanner;
public class Coder {

    public static void main(String[] args) {
        int result = 0;
        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextInt();
        for(int i = 1 ; i <= input ; i ++){
            result += i;
        }
        System.out.print(result);
    }
    
}


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

class candySum｛
     public static void main(String args［］)
          int student_num = 0;
          int candy_sun = 0;
          for(student_num=0;student_num＜N; student_num++)｛
               candySum = candySum + 1;
          ｝
          System.out.println(candySum);
｝

Compiler output:
Main.java:1: error: illegal character: '\uff5b'
class candySum?
              ^
Main.java:2: error: illegal character: '\uff3b'
     public static void main(String args??)
                                        ^
Main.java:2: error: illegal character: '\uff3d'
     public static void main(String args??)
                                         ^
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
     public static void main(String args??)
                   ^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: class, interface, enum, or record expected
          for(student_num=0;student_num?N; student_num++)?
          ^
Main.java:5: error: illegal character: '\uff1c'
          for(student_num=0;student_num?N; student_num++)?
                                       ^
Main.java:5: error: class, interface, enum, or record expected
          for(student_num=0;student_num?N; student_num++)?
                                           ^
Main.java:5: error: illegal character: '\uff5b'
          for(student_num=0;student_num?N; student_num++)?
                                                         ^
Main.java:7: error: illegal character: '\uff5d'
          ?
          ^
Main.java:8: error: class, interface, enum, or record expected
          System.out.println(candySum);
                ^
Main.java:9: error: illegal character: '\uff5d'
?
^
Main.java:9: error: reached end of file while parsing
?
 ^
12 errors
Language: Java

class candySum｛
     public static void main(String args［］)
          int student_num = 0;
          int candy_sun = 0;
          for(student_num=0 ,student_num＜N, student_num++)｛
               candySum = candySum + 1;
          ｝
          System.out.println(candySum);
｝

Compiler output:
Main.java:1: error: illegal character: '\uff5b'
class candySum?
              ^
Main.java:2: error: illegal character: '\uff3b'
     public static void main(String args??)
                                        ^
Main.java:2: error: illegal character: '\uff3d'
     public static void main(String args??)
                                         ^
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
     public static void main(String args??)
                   ^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: class, interface, enum, or record expected
          for(student_num=0 ,student_num?N, student_num++)?
          ^
Main.java:5: error: illegal character: '\uff1c'
          for(student_num=0 ,student_num?N, student_num++)?
                                        ^
Main.java:5: error: illegal character: '\uff5b'
          for(student_num=0 ,student_num?N, student_num++)?
                                                          ^
Main.java:7: error: illegal character: '\uff5d'
          ?
          ^
Main.java:8: error: class, interface, enum, or record expected
          System.out.println(candySum);
                ^
Main.java:9: error: illegal character: '\uff5d'
?
^
Main.java:9: error: reached end of file while parsing
?
 ^
11 errors
Language: Java

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

public class ChildrenCandies{
  public static void main(String args[]){
    try{
      BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
      String str = br.readLine();
      int N = Integer.parseInt(str);
      int h = 0;
      while(N > 0){
        h = h + N;
        N--;
      }
      System.out.println(N);
    }catch(IOException e){
      System.out.println(e);
    }
  }
}

Compiler output:
Main.java:7: error: class ChildrenCandies is public, should be declared in a file named ChildrenCandies.java
public class ChildrenCandies{
       ^
Main.java:10: error: cannot find symbol
      BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
                              ^
  symbol:   class BuffredReader
  location: class ChildrenCandies
2 errors
Language: Java

import java.io.*;

public class ChildrenCandies{
  public static void main(String args[]){
    try{
      BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
      String str = br.readLine();
      int N = Integer.parseInt(str);
      int h = 0;
      while(N > 0){
        h = h + N;
        N--;
      }
      System.out.println(N);
    }catch(IOException e){
      System.out.println(e);
    }
  }
}

Compiler output:
Main.java:3: error: class ChildrenCandies is public, should be declared in a file named ChildrenCandies.java
public class ChildrenCandies{
       ^
Main.java:6: error: cannot find symbol
      BufferedReader br = new BuffredReader(new InputStreamReader(System.in));
                              ^
  symbol:   class BuffredReader
  location: class ChildrenCandies
2 errors
Language: Java

import java.util.Scanner;

public class test1 {

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

		System.out.println((1 + n) * n / 2);

	}

}

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