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

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

public class Main{
	public static void main(String[] args)throws IOException{
		int count=0;
		int add=0;
		int ave3,ave2
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int n = Integer.parseInt(str[0]);
			int x = Integer.parseInt(str[1]);
			
			if((n == 0) && (x == 0)){
				break;
			}
			
			ave3 = x / 3;
			for(int i=1; i<ave3; i++){
				ave2 = (x - i) / 2;
				for(j=i+1; j<=ave2; j++){
					int k = x - i = j;
					if(j < k && k <= n){
						count++;
					}
				}
			}
			System.out.println(count);
		}
	}
}

Compiler output:
Main.java:9: error: ';' expected
		int ave3,ave2
		             ^
1 error
Language: Java

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

public class Main{
	public static void main(String[] args)throws IOException{
		int count=0;
		int add=0;
		int ave3,ave2;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int n = Integer.parseInt(str[0]);
			int x = Integer.parseInt(str[1]);
			
			if((n == 0) && (x == 0)){
				break;
			}
			
			ave3 = x / 3;
			for(int i=1; i<ave3; i++){
				ave2 = (x - i) / 2;
				for(j=i+1; j<=ave2; j++){
					int k = x - i = j;
					if(j < k && k <= n){
						count++;
					}
				}
			}
			System.out.println(count);
		}
	}
}

Compiler output:
Main.java:26: error: cannot find symbol
				for(j=i+1; j<=ave2; j++){
				    ^
  symbol:   variable j
  location: class Main
Main.java:26: error: cannot find symbol
				for(j=i+1; j<=ave2; j++){
				           ^
  symbol:   variable j
  location: class Main
Main.java:26: error: cannot find symbol
				for(j=i+1; j<=ave2; j++){
				                    ^
  symbol:   variable j
  location: class Main
Main.java:27: error: unexpected type
					int k = x - i = j;
					          ^
  required: variable
  found:    value
Main.java:27: error: cannot find symbol
					int k = x - i = j;
					                ^
  symbol:   variable j
  location: class Main
Main.java:28: error: cannot find symbol
					if(j < k && k <= n){
					   ^
  symbol:   variable j
  location: class Main
6 errors
Language: Java

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

public class Main{
	public static void main(String[] args)throws IOException{
		int count=0;
		int add=0;
		int ave3,ave2;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int n = Integer.parseInt(str[0]);
			int x = Integer.parseInt(str[1]);
			
			if((n == 0) && (x == 0)){
				break;
			}
			
			ave3 = x / 3;
			for(int i=1; i<ave3; i++){
				ave2 = (x - i) / 2;
				for(int j=i+1; j<=ave2; j++){
					int k = x - i = j;
					if(j < k && k <= n){
						count++;
					}
				}
			}
			System.out.println(count);
		}
	}
}

Compiler output:
Main.java:27: error: unexpected type
					int k = x - i = j;
					          ^
  required: variable
  found:    value
1 error
Language: Java

import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String line = reader.readLine();
			String[] str = line.split(" ", -1);
			int n = Integer.parseInt(str[0]);
			int x = Integer.parseInt(str[1]);
			if(n == 0 && x == 0){
				break;
			}
			int count = 0;
			int a = 1
			int b = 2
			int c = 3
			while(true){
				if(b >= c){
					a++;
					b = a + 1;
					c = b + 1;
				}
				if(c > n){
					b++;
					c += 2;
				}
				if(a + b + c == n){
					count++;
				}
				if(a * 3 + 3 > n){
					break;
				}
				c++;
			}
			System.out.println(count);
		 }
	}
}

Compiler output:
Main.java:14: error: ';' expected
			int a = 1
			         ^
Main.java:15: error: ';' expected
			int b = 2
			         ^
Main.java:16: error: ';' expected
			int c = 3
			         ^
3 errors
Language: Java

import java.io.*;

public class max {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine( );
        String[] stringLine = line.split("\n");
        int k = stringLine.length;
        String[] stringArrayN = new String[k-1];
        String[] stringArrayX = new String[k-1];
        int[] numArrayN = new int[k-1];
        int[] numArrayX = new int[k-1];
        int count = 0;
        for(int j=0;j<k-1;j++){
        	stringArrayN[j] = stringLine[j].split(" ")[0];
        	stringArrayN[j] = stringLine[j].split(" ")[1];
        	numArrayN[j] = Integer.parseInt(stringArrayN[j]);
        	numArrayX[j] = Integer.parseInt(stringArrayX[j]);
        	for(int s=0;s<numArrayN[j];s++){
        		for(int t=0;t<numArrayN[j];t++){
        			for(int u=0;u<numArrayN[j];u++){
        				if(s+t+u==numArrayX[j] && s!=t && t!=u && u!=s){
        					count++;
        				}
        			}
        		}
        	}
        	System.out.println(count);
        }
	}

}

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

import java.io.*;
public class max {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine( );
        String[] stringLine = line.split("\n");
        int k = stringLine.length;
        int[] numArrayN = new int[k];
        int[] numArrayX = new int[k];
        int count = 0;
        for(int j=0;j<k;j++){
        	numArrayN[j] = Integer.parseInt(stringLine[j].split(" ")[0]);
        	numArrayX[j] = Integer.parseInt(stringLine[j].split(" ")[1]);
        	for(int s=1;s<=numArrayN[j];s++){
        		for(int t=s+1;t<=numArrayN[j];t++){
        			for(int u=t+1;u<=numArrayN[j];u++){
        				if(s+t+u==numArrayX[j]){
        					count++;
        				}
        			}
        		}
        	}
        	System.out.println(count);
        }
	}

}

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

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			int sum;
			for(int j = 1; j <= n; j++){
				for(int a = 1; a < n; a++){
					for(int d = 1; d < n; d++){
						for(int e = 1; e < n; e++){
							sum = 3a + 2d + e;
							if(sum == x){
								cnt++;
							}
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:28: error: ';' expected
							sum = 3a + 2d + e;
							       ^
Main.java:28: error: not a statement
							sum = 3a + 2d + e;
							              ^
2 errors
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			for(int j = 1; j <= n; j++){
				for(int a = 1; a < n; a++){
					for(int d = 1; d < n; d++){
						for(int e = 1; e < n; e++){
							int sum = 3a + 2d + e;
							if(sum == x){
								cnt++;
							}
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:27: error: ';' expected
							int sum = 3a + 2d + e;
							           ^
Main.java:27: error: not a statement
							int sum = 3a + 2d + e;
							                  ^
2 errors
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			for(int a = 1; a < n; a++){
				for(int d = 1; d < n; d++){
					for(int e = 1; e < n; e++){
						int sum = 3a + 2d + e;
						if(sum == x){
							cnt++;
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:26: error: ';' expected
						int sum = 3a + 2d + e;
						           ^
Main.java:26: error: not a statement
						int sum = 3a + 2d + e;
						                  ^
2 errors
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			for(int a = 1; a < n; a++){
				for(int d = 1; d < n; d++){
					for(int e = 1; e < n; e++){
						int sum = 3 * a + 2 * d + e;
						if((a < a + d) && ((a + d) < (a + d + e)){
							if(sum == x){
								cnt++;
							}
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:27: error: ')' expected
						if((a < a + d) && ((a + d) < (a + d + e)){
						                                         ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			for(int a = 1; a < n; a++){
				for(int d = 1; d < n; d++){
					for(int e = 1; e < n; e++){
						int sum = 3 * a + 2 * d + e;
						if(((a < a + d) && ((a + d) < (a + d + e))){
							if(sum == x){
								cnt++;
							}
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:27: error: ')' expected
						if(((a < a + d) && ((a + d) < (a + d + e))){
						                                           ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			for(int a = 1; a < n; a++){
				for(int d = 1; d < n; d++){
					for(int e = 1; e < n; e++){
						int sum = 3 * a + 2 * d + e;
						if(((a < (a + d) && ((a + d) < (a + d + e))){
							if(sum == x){
								cnt++;
							}
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:27: error: ')' expected
						if(((a < (a + d) && ((a + d) < (a + d + e))){
						                                            ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			for(int a = 1; a <= n; a++){
				for(int b = 1; b <= n; b++){
					for(int c = 1; c <= n; c++){
						int sum = 3 * a + 2 * b + c;
						if((a < (a + b) && ((a + b) < (a + b + c))){
							if(sum == x){
								cnt++;
							}
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:27: error: ')' expected
						if((a < (a + b) && ((a + b) < (a + b + c))){
						                                           ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		List<Integer> listN = new ArrayList<Integer>();
		List<Integer> listX = new ArrayList<Integer>();
		for(;;){
			int n = scan.nextInt();
			int x = scan.nextInt();
			if((n == 0) && (x == 0)){
				break;
			}
			listN.add(n);
			listX.add(x);
		}

		for(int i = 0; i < listN.size(); i++){
			int n = listN.get(i);
			int x = listX.get(i);
			int cnt = 0;
			for(int a = 1; a <= n; a++){
				for(int b = 1; b <= n; b++){
					for(int c = 1; c <= n; c++){
						int sum = 3 * a + 2 * b + c;
						if(((a < (a + b)) && ((a + b) < (a + b + c))){
							if(sum == x){
								cnt++;
							}
						}
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Compiler output:
Main.java:27: error: ')' expected
						if(((a < (a + b)) && ((a + b) < (a + b + c))){
						                                             ^
1 error
Language: Java

package internship;

import java.util.Scanner;

public class way {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		do {
			int n = sc.nextInt();
			/*
			 * if(n > 3 && n < 100){
			 *
			 * }
			 */

			int x = sc.nextInt();
			int cnt = 0;
			int sum = 0;

			for (int i = 1; i < 3; i++)
				for (int j = 3; j < n; j++)
					for (int k = n-1; k < x; k++)
						// ????????????
						if (n == 0 && x == 0)
							break;

						else if (i != j && j != k && k != i) {
							sum = i+j+k;
							System.out.println(" "+i+" "+j+" "+k);
							cnt = check(sum,x,cnt);

						}
			System.out.println();
			System.out.println(cnt);

		} while (true);

	}

	static int check(int sum, int x, int cnt) {
		if (sum == x){
			cnt++;

			System.out.println(sum+""+cnt);
		}

		return cnt;
	}

}

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


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

public class Main{

	public static void main(String[] args) throws IOException {


Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
 
        while(true){
            final String[] data = sc.nextLine().split(" ");
            final int n = Integer.parseInt(data[0]);
            final int x = Integer.parseInt(data[1]);
            if(n == 0 && x == 0) break;
            int count = 0;
            for(int i = 1; i <= n - 2; i++){
                for(int j = i + 1; j <= n - 1; j++){
                    for(int k = j + 1; k <= n; k++){
                        if((i + j + k) == x) count++;
                    }
                }
            }
            System.out.println(count);
        }
    }

Compiler output:
Main.java:29: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

package Intro;

import java.util.Scanner;


public class How_many_ways {

	public static int  Clc(int N , int X) {
		int count = 0;
		for(int x = 1; x <= N ; x++){
			for(int y = 2; y <= N ; y++){
				if(x==y){break;}
				for(int z =3 ; z <= N ; z++){
					if(x==z || y == z){break;}
						if((x+y+z)==X){count++;}
				}
			}
		}

		return count;


	}

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = 0;

		while(true){
			int N = scanner.nextInt();
			int X = scanner.nextInt();
			if(N == 0 && X == 0){break;}
			count = Clc(N, X);
			System.out.println(count);
		}
	}


}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
class Main{
  public static void main(String args[]) throws IOException{
   int ans = 0;
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   
   while(true){
   String[] token = br.readLine().split(" ");
    int n = Integer.parseInt(token[0]);      
    int x = Integer.parseInt(token[1]);
    if(n == 0 && x == 0) {break;}
??????for(int i = 1; i <= n ; i++){
     for(int j = i + 1; j <= n; j++){
      for(int k = j + 1; k <= n; k++){
       if(i+j+k==x){ans++;}
      }//for 
     }//for
    }//for
  
   }//while
 
 }
}

Compiler output:
Main.java:15: error: illegal start of expression
??????for(int i = 1; i <= n ; i++){
^
Main.java:15: error: illegal start of expression
??????for(int i = 1; i <= n ; i++){
 ^
Main.java:15: error: illegal start of expression
??????for(int i = 1; i <= n ; i++){
  ^
Main.java:15: error: illegal start of expression
??????for(int i = 1; i <= n ; i++){
   ^
Main.java:15: error: illegal start of expression
??????for(int i = 1; i <= n ; i++){
    ^
Main.java:15: error: illegal start of expression
??????for(int i = 1; i <= n ; i++){
     ^
Main.java:15: error: illegal start of expression
??????for(int i = 1; i <= n ; i++){
      ^
7 errors
Language: Java

import java.util.Scanner;

class Main{
      public static void main(String[] args){
	//???????????\???
    	Scanner scan = new Scanner(System.in);
    	int n;
    	int x;
    	int total = 0;
    	int c = 3 * 2 * 1; //3?????????????????????????????????????????????
    	int end = 0;
    	
	
    	for(int count;;count = 0;){
		//???????????´??°?????????????????£??\
    		n = scan.nextInt();
    		x = scan.nextInt();
    		
		//????????¨???0????????????
    		if(n == end && x == end){
    			break;
    		}
    		
    		for(int i = 1; i <= n; i++){
    			for(int j = 1; j <= n; j++){
    				for(int k = 1; k <= n; k++){
    					if(i != j && j != k && k != i){
	    					total = i + j + k;
	    	    			if(x == total) count++;
    					}
    	    		}
        		}
    		}
		count /= c
    		System.out.println(count);
    	}
    }
}

Compiler output:
Main.java:14: error: ')' expected
    	for(int count;;count = 0;){
    	                        ^
Main.java:14: error: illegal start of expression
    	for(int count;;count = 0;){
    	                         ^
Main.java:34: error: ';' expected
		count /= c
		          ^
3 errors
Language: Java

//API???????????????
import java.util.Scanner;

class Main{
      public static void main(String[] args){
	//???????????\???
    	Scanner scan = new Scanner(System.in);
    	int n;
    	int x;
    	int total = 0;
    	int c = 3 * 2 * 1; //3?????????????????????????????????????????????
    	int end = 0;
    	
	
    	for(int count = 0;;count = 0;){
		//???????????´??°?????????????????£??\
    		n = scan.nextInt();
    		x = scan.nextInt();
    		
		//????????¨???0????????????
    		if(n == end && x == end){
    			break;
    		}
    		
    		for(int i = 1; i <= n; i++){
    			for(int j = 1; j <= n; j++){
    				for(int k = 1; k <= n; k++){
    					if(i != j && j != k && k != i){
	    					total = i + j + k;
	    	    			if(x == total) count++;
    					}
    	    		}
        		}
    		}
		count /= c
    		System.out.println(count);
    	}
    }
}

Compiler output:
Main.java:15: error: ')' expected
    	for(int count = 0;;count = 0;){
    	                            ^
Main.java:15: error: illegal start of expression
    	for(int count = 0;;count = 0;){
    	                             ^
Main.java:35: error: ';' expected
		count /= c
		          ^
3 errors
Language: Java

import java.util.Scanner;

class Main{
      public static void main(String[] args){
	//???????????\???
    	Scanner scan = new Scanner(System.in);
    	int n;
    	int x;
    	int total = 0;
    	int c = 3 * 2 * 1; //3?????????????????????????????????????????????
    	int end = 0;
    	
	
    	for(int count = 0;;count = 0){
		//???????????´??°?????????????????£??\
    		n = scan.nextInt();
    		x = scan.nextInt();
    		
		//????????¨???0????????????
    		if(n == end && x == end){
    			break;
    		}
    		
    		for(int i = 1; i <= n; i++){
    			for(int j = 1; j <= n; j++){
    				for(int k = 1; k <= n; k++){
    					if(i != j && j != k && k != i){
	    					total = i + j + k;
	    	    			if(x == total) count++;
    					}
    	    			}
        		}
    		}
		count /= c
    		System.out.println(count);
    	}
    }
}

Compiler output:
Main.java:34: error: ';' expected
		count /= c
		          ^
1 error
Language: Java

import java.util.*;
 public class Main{
  public static void main{
   while(true){
    int n = scan.nextInt();
        n>=1;
    int a = scan.nextInt();
         1<= a <=n;
    int b = scan.nextInt();
         b!=a && 1<= b <=n;
    int c = scan.nextInt();
         c!=b && c!=a && 1<=c<=n;
    int x = a+b+c;
    if(n==0 && x==0)break;
    System.out.println(n+" "+x);
   }
 }
}

Compiler output:
Main.java:3: error: '(' expected
  public static void main{
                         ^
Main.java:6: error: not a statement
        n>=1;
         ^
Main.java:8: error: not a statement
         1<= a <=n;
               ^
Main.java:10: error: not a statement
         b!=a && 1<= b <=n;
              ^
Main.java:12: error: not a statement
         c!=b && c!=a && 1<=c<=n;
                      ^
5 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
  Scanner scan=new Scanner(System.in);

  int n,sum;

  while(in.hasNext()){
  int count = 0;
  n = scan.nextInt();
  sum = scan.nextInt();

  if(n==0 && count==0)break;

    for(int i=1;i<n;i++){
      for(int j=1;j<n;j++){
      int r =sum - i - j;
        if(r>j && r<=n){
        count++;
        }
      }
    }
    System.out.println(count);
  }
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
  while(in.hasNext()){
        ^
  symbol:   variable in
  location: class Main
1 error
Language: Java

import java.util.Scanner;

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

        String[] inputs = scan.nextLine().split(" ");
        int n = Integer.parseInt(inputs[0]);
        int x = Integer.parseInt(inputs[1]);
        int num = 0;
        int k;

        for (int i=1; i<n-1; i++){
            for (int j=i+1; j<n; j++){
                for (int k=j+1; k<n+1; k++){
                    if (i+j+k == x){
                        num += 1;
                        break;
                    }
                }
            }
        }
        if (num != 0){
            System.out.println(num);
        }
    }
}

Compiler output:
Main.java:15: error: variable k is already defined in method main(String[])
                for (int k=j+1; k<n+1; k++){
                         ^
1 error
Language: Java

package test;

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

public class test1 {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n,x;
		String str;
		String strs[];

		while (true) {
			str = br.readLine();
			strs=str.split(" ");
			n=Integer.parseInt(strs[0]);
			x=Integer.parseInt(strs[1]);
			if(n==0&&x==0){
				break;
			}
			int cnt = 0;
			for(int i=1;i<=n-2;i++){
				for(int j=i+1;j<=n-1;j++){
					for(int k=j+1;k<=n;k++){
						if(i+j+k==x){
							cnt++;
						}
					}
				}
			}
			System.out.println(cnt);
		}

	}

}

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

import java.io.*;

public class HowManyWays {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//Scanner sc = new Scanner(System.in) ;
        String[] str;
		int sum = 0;           //sum??????????????°???????¨???§???
		int N = 0 ;         //N ???????¨????x??¨??????????????????????????°??§???
		
		while(true) {
	//??\???????????????????????????
		str = br.readLine().split(" ");	
		int n = Integer.parseInt(str[0]);
		int x = Integer.parseInt(str[1]);;
		if(n == 0 & x == 0) break;
	//?¨???????????????????????????????	   
		else {
			for(int i = 1; i <= n; i++) {
			   for(int j = (i+1) ; j <= n ; j++) {
				  for(int k = (j+1) ; k <= n ; k++) {
					 sum = i+j+k ;
					 if(sum == x) {
						N ++ ;
					  }  
				  }
			   }
		    }
		}
			
	    }
	//??????????????????????????????
	   System.out.println(N);
 
	   br.close();
	}

}

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

import java.util.Scanner;

public class Howmanyways {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//StringBuilder file = new StringBuilder();
		int f = 0; //????¨??????????x????????????????????????????????????????????????
		int n ;    //n????????°????????§
		int x ;    //????¨???????x
	
		while(true) {
			    n = sc.nextInt();
			    x = sc.nextInt();
		if(n == 0 & x == 0) break;
		
		else {
	//?¨????????????????????????????????????????	
			for(int i = 1 ; i <= n ; i++) {
			for(int j = i+1 ; j <= n ; j++ ) {
				for(int k = j+1 ; k <= n ; k++) {
					if(i+j+k == x) {
						f++;
					}
				}
			}
		  }
			
		}
	       //	file.append(f);
	
	}
     System.out.println(f);
     
 sc.close();
	}

}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n;
		int x;
		while (true) {
			n = sc.nextInt();
			x = sc.nextInt();
			if (n == 0 && x == 0)
				break;
			calcWays(n, x);
		}

	}

	public static void calcWays(int n, int x) {
		int ways = 0;
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= n; j++) {
				for (int k = 1; k <= n; k++) {
					if (i > j && j > k && i + j + k == x) {
						ways++;
					}
				}
			}
		}
		System.out.println(ways);
	}

Compiler output:
Main.java:31: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

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

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		
		while(true){
			int n = scanner.nextInt();
			int x = scanner.nextInt();
			int count = 0;

			if(n == 0 && f == 0){
				break;
			}

			for(int i = 1; i < x/3; i++){
				for(int j = 2; j < n; j++){
					int k = x - i - j
					if(k > j && k <= n){
						count ++
					}
				}
			}
			System.out.println(count);
		}
	}

}

Compiler output:
Main.java:19: error: ';' expected
					int k = x - i - j
					                 ^
Main.java:21: error: ';' expected
						count ++
						        ^
2 errors
Language: Java

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

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		
		while(true){
			int n = scanner.nextInt();
			int x = scanner.nextInt();
			int count = 0;

			if(n == 0 && f == 0){
				break;
			}

			for(int i = 1; i < x/3; i++){
				for(int j = 2; j < n; j++){
					int k = x - i - j;
					if(k > j && k <= n){
						count ++;
					}
				}
			}
			System.out.println(count);
		}
	}

}

Compiler output:
Main.java:13: error: cannot find symbol
			if(n == 0 && f == 0){
			             ^
  symbol:   variable f
  location: class Main
1 error
Language: Java

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


public class Main{
 public static void  main(String[] args){
  BufferredReader br = new BufferredReader(new InputStreamReader(System.in));
  String str = br.readLine();
                    
                    while(str !=null){
                        String[] temp = str.split("\\s");
                        int Enum = Integer.parseInt(temp[0]);
                        int target = Integer.parseInt(temp[1]);

                        if(Enum ==0 && target ==0){
                            break;
                        }
                        
                        int count =0;
                        for(int i =1;i<=Enum-2;i++){
                            for(int j=i+1;j<=Enum-1;j++){
                                for(int k=j+1;k<=Enum;k++){
                                    int total = 0;
                                    total = i + j + k;
                                    if(total == target){
                                        count++;
                                    }
                                }
                            }                    
                        }
                        System.out.println(count);

 }
}

Compiler output:
Main.java:34: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.*;
import java.io.*;
 
 
public class Main{
 public static void  main(String[] args)throws IOException{
  BufferredReader br = new BufferredReader(new InputStreamReader(System.in));
  String str = br.readLine();
                     
                    while(str !=null){
                        String[] temp = str.split("\\s");
                        int Enum = Integer.parseInt(temp[0]);
                        int target = Integer.parseInt(temp[1]);
 
                        if(Enum ==0 && target ==0){
                            break;
                        }
                         
                        int count =0;
                        for(int i =1;i<=Enum-2;i++){
                            for(int j=i+1;j<=Enum-1;j++){
                                for(int k=j+1;k<=Enum;k++){
                                    int total = 0;
                                    total = i + j + k;
                                    if(total == target){
                                        count++;
                                    }
                                }
                            }                    
                        }
                        System.out.println(count);
 
                    } 
 }
}

Compiler output:
Main.java:7: error: cannot find symbol
  BufferredReader br = new BufferredReader(new InputStreamReader(System.in));
  ^
  symbol:   class BufferredReader
  location: class Main
Main.java:7: error: cannot find symbol
  BufferredReader br = new BufferredReader(new InputStreamReader(System.in));
                           ^
  symbol:   class BufferredReader
  location: class Main
2 errors
Language: Java

import java.util.*;
import java.io.*;
 
 
public class aaa{
 public static void  main(String[] args)throws IOException{
  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  String str = br.readLine();
                     
                    while(str !=null){
                        String[] temp = str.split("\\s");
                        int Enum = Integer.parseInt(temp[0]);
                        int target = Integer.parseInt(temp[1]);
 
                        if(Enum ==0 && target ==0){
                            break;
                        }
                         
                        int count =0;
                        for(int i =1;i<=Enum-2;i++){
                            for(int j=i+1;j<=Enum-1;j++){
                                for(int k=j+1;k<=Enum;k++){
                                    int total = 0;
                                    total = i + j + k;
                                    if(total == target){
                                        count++;
                                    }
                                }
                            }                    
                        }
                        System.out.println(count);
                        str = br.readLine();
 
                    } 
 }
}

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

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		while(true){
			String[] line =sc.nextLine().split(" ");
			int n = Integer.parseInt(line[0]);
			int x = Integer.parseInt(line[1]);
		//break	
			if(n==0 && x==0){
				break;
			}
			System.our.println(sum(n,x));
		}					
		public int sum(int n,int x){
			int count=0;
			for(int i=0;i<n;i++){
				for(int j=0;j<i;j++){
					for(int k=0;k<j;k++){
						if(x-1==i+j+k){
							count=count+1;
						}
					}
				}
			}
			return count;
		}
	}
}

Compiler output:
Main.java:16: error: illegal start of expression
		public int sum(int n,int x){
		^
Main.java:30: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		while(true){
			String[] line =sc.nextLine().split(" ");
			int n = Integer.parseInt(line[0]);
			int x = Integer.parseInt(line[1]);
		//break	
			if(n==0 && x==0){
				break;
			}
			System.our.println(sum(n,x));
		}					
		public static int sum(int n,int x){
			int count=0;
			for(int i=0;i<n;i++){
				for(int j=0;j<i;j++){
					for(int k=0;k<j;k++){
						if(x-1==i+j+k){
							count=count+1;
						}
					}
				}
			}
			return count;
		}
	}
}

Compiler output:
Main.java:16: error: illegal start of expression
		public static int sum(int n,int x){
		^
Main.java:30: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		while(true){
			String[] line =sc.nextLine().split(" ");
			int n = Integer.parseInt(line[0]);
			int x = Integer.parseInt(line[1]);
		//break	
			if(n==0 && x==0){
				break;
			}
			System.our.println(sum(n,x));
		}					

	}
}
		public static int sum(int n,int x){
			int count=0;
			for(int i=0;i<n;i++){
				for(int j=0;j<i;j++){
					for(int k=0;k<j;k++){
						if(x-1==i+j+k){
							count=count+1;
						}
					}
				}
			}
			return count;
		}

Compiler output:
Main.java:19: error: unnamed classes are a preview feature and are disabled by default.
		public static int sum(int n,int x){
		              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc= new Scanner(System.in);
		while(true){
			String[] line =sc.nextLine().split(" ");
			int n = Integer.parseInt(line[0]);
			int x = Integer.parseInt(line[1]);
		//break	
			if(n==0 && x==0){
				break;
			}
			System.our.println(sum(n,x));
		}					

	}
	public static int sum(int n,int x){
		int count=0;
		for(int i=0;i<n;i++){
			for(int j=0;j<i;j++){
				for(int k=0;k<j;k++){
					if(x-1==i+j+k){
						count=count+1;
					}
				}
			}
		}
		return count;
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
			System.our.println(sum(n,x));
			      ^
  symbol:   variable our
  location: class System
1 error
Language: Java

import java.util.Scanner; 
public class Grading { 
	public static void main(String... args) { 
		Scanner sc = new Scanner(System.in); 
		while(true) { 
			
			int n = sc.nextInt(); 
			int x = sc.nextInt(); 
			
			if(n == 0 && x == 0) break; 
			
			int count = 0;
			
			for(int a=1; a<=n; a++){
				for (int b=a+1; b<=n; b++) {
					for (int c=b+1; c<=n; c++) {
						if (a+b+c == x) {
							count++;
						}
					}
				}
			}
			
			
			
			System.out.println(count); 
		} 
	} 
}


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

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

public class HowManyWays {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while(true) {
			int n = sc.nextInt();
			int x = sc.nextInt();

			if(n == 0 && x == 0) break;

			int count = 0;
			// 重複リスト
			ArrayList<ArrayList<Integer>> duplications = new ArrayList<>();

			for(int i=1; i<=n; i++) {
				// 条件に合う組み合わせを数える
				for(int j=1; j<=n; j++) {
//					if(duplications.indexOf(j) != -1) continue;
					if(j==i) continue;
					for(int y=1; y<=n; y++) {
//						if(duplications.indexOf(y) != -1) continue;
						if(y == j || y == i) continue;
//						System.out.println(i + ", " + j + ", " + y);
						if((i+j+y) == x) {
							// 重複チェック
							Boolean breakFlag = false;
							for(ArrayList<Integer> dup : duplications) {
								if(dup.indexOf(i) != -1 && dup.indexOf(j) != -1 && dup.indexOf(y) != -1) {
//									System.out.println("重複!! : " + i + ", " + j + ", " + y);
									breakFlag = true;
									break;
								}
								if(breakFlag) break;
							}
							if(!breakFlag) {
//								System.out.println(i + ", " + j + ", " + y);
								count++;
								ArrayList<Integer> dup = new ArrayList<>();
								dup.add(i);
								dup.add(j);
								dup.add(y);
								duplications.add(dup);
							}
						}
					}
				}
			}

			System.out.println(count);
		}

		sc.close();

	}

}


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

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {

		int n = 0;
		int x = 0;
		int cnt = 0;
		
		Scanner sc= new Scanner( System.in );

		while ( true ) {
			n = sc.nextInt();
			x = sc.nextInt();

			if ( n == 0 && x == 0 ) {
				break;
			}

			for ( int i = 1 ; i < ( n - 1 ) ; i++ ) {
				for  ( int j = ( i + 1 ) ; j < n ; j++ ) {
					for ( int k = ( j + 1 ) ; k < ( n + 1 ) ; k++ ) {
//						System.out.println( i + " " + j + " " + k );
						if ( ( i + j + k ) == x ) {
							cnt++;
						}
					}
				}

			}
			System.out.println( cnt );
		}
		sc.close();
	}
}


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

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {

		int n = 0;
		int x = 0;
		int cnt = 0;
		
		Scanner sc= new Scanner( System.in );

		while ( true ) {
			n = sc.nextInt();
			x = sc.nextInt();

			if ( n == 0 && x == 0 ) {
				break;
			}

			for ( int i = 1 ; i < ( n - 1 ) ; i++ ) {
				for  ( int j = ( i + 1 ) ; j < n ; j++ ) {
					for ( int k = ( j + 1 ) ; k < ( n + 1 ) ; k++ ) {
//						System.out.println( i + " " + j + " " + k );
						if ( ( i + j + k ) == x ) {
							cnt++;
						}
					}
				}

			}
			System.out.println( cnt );
		}
		sc.close();
	}
}



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

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {

		int n = 0;
		int x = 0;
		int cnt = 0;
		
		Scanner sc= new Scanner( System.in );

		while ( true ) {
			n = sc.nextInt();
			x = sc.nextInt();

			if ( n == 0 && x == 0 ) {
				break;
			}

			for ( int i = 1 ; i < ( n - 1 ) ; i++ ) {
				for  ( int j = ( i + 1 ) ; j < n ; j++ ) {
					for ( int k = ( j + 1 ) ; k < ( n + 1 ) ; k++ ) {
						if ( ( i + j + k ) == x ) {
							cnt++;
						}
					}
				}

			}
			System.out.println( cnt );
		}
		sc.close();
	}
}


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

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		while(true) {
			int sum=0;
			int n=scan.nextInt();
			int a=scan.nextInt();
			for(int i=1;i<=n;i++) {
				
				for(int j=1;j<=n;j++) {
					for(int k=1;k<=n;k++) {
						
					}
				}
			}
		}
		scan.close();
}
}


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

mport java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main {
 
    public static final int BIG_NUM  = 2000000000;
    public static final int MOD  = 1000000007;
 
    public static void main(String[] args) {
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String buffer[] = new String[2];
        int N,X,ans;
 
        while(true){
 
            try {
                buffer = br.readLine().split("\\s+");
                N = Integer.parseInt(buffer[0]);
                X = Integer.parseInt(buffer[1]);
 
                if(N == 0 && X == 0)break;
 
                ans = 0;
 
                for(int a = 1; a <= N-2; a++){
                    for(int b = a+1; b <= N-1; b++){
                        for(int c = b+1; c <= N; c++){
                            if(a+b+c == X){
                                ans++;
                            }
                        }
                    }
                }
 
                System.out.printf("%d\n", ans);
 
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.io.BufferedReader;
^
Main.java:2: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:3: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
3 errors
Language: Java

import java.awt.*;
import java.awt.geom.*;
import java.io.*;
 
import java.util.*;
class Main {
 
    static char[] xx = new char[] {'S','H','C','D'};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt();
            int x = sc.nextInt();
            if(n == 0 && x == 0) break;
            int count = 0;
            for (int i = 1; i <= n; i++) {
                for (int j = i + 1; j <= n; j++) {
                    for (int k = j + 1; k <= n; k++) {
                        if (i + j + k == x) {
                            count++;
                        }
                    }
                }
            }
            System.out.println(count);
        }
 
    }
}

Compile Error Logs:

ステータス
Judge: 4/4	JAVA	CPU: 00:07 sec	Memory: 19652 KB	Length: 565 B	2015-07-11 14:37
テストケースの判定結果
Case #	Verdict	CPU Time	Memory	In	Out	Case Name
Case #1	: Accepted	00:05	17164	8	2	testcase_00
Case #2	: Accepted	00:06	18872	28	10	testcase_01
Case #3	: Accepted	00:05	17236	85	36	testcase_02
Case #4	: Accepted	00:07	19652	297	163	testcase_03

< prev |		/		| next >	 		
 
Judge Input #  ( | )		Judge Output #  ( | )



Compiler output:
Main.java:31: error: class, interface, enum, or record expected
Compile Error Logs:
^
Main.java:36: error: illegal character: '#'
Case #	Verdict	CPU Time	Memory	In	Out	Case Name
     ^
Main.java:37: error: illegal character: '#'
Case #1	: Accepted	00:05	17164	8	2	testcase_00
     ^
Main.java:38: error: illegal character: '#'
Case #2	: Accepted	00:06	18872	28	10	testcase_01
     ^
Main.java:39: error: illegal character: '#'
Case #3	: Accepted	00:05	17236	85	36	testcase_02
     ^
Main.java:40: error: illegal character: '#'
Case #4	: Accepted	00:07	19652	297	163	testcase_03
     ^
Main.java:44: error: illegal character: '#'
Judge Input #  ( | )		Judge Output #  ( | )
            ^
Main.java:44: error: illegal character: '#'
Judge Input #  ( | )		Judge Output #  ( | )
                    		             ^
8 errors
Language: Java

import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int n=scan.nextInt();
    int x=scan.nextInt();
    int count=0;

    for(int i=1;i<n-1;i++){
      for(int j=i+1;j<n;j++){
        for(int k=j+1;k<n+1;k++){
          if(i+j+k==x) count++;
        }
      }
    }
    System.out.println(count);
  }System.out.println();
}



Compiler output:
Main.java:18: error: <identifier> expected
  }System.out.println();
                     ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
    pubilc static void main(String[] args){
        Scaner sc=new Scanner(System.in);
        int i,j,k,l,n,x,count=0;
        for(i=0;;i++){
            n=sc.nextInt();
            x=sc.nextInt();
            if((n==0)&&(x==0)){
                break;
            }else{
                for(j=1;j<=n-2;j++){
                    for(k=j+1;k<=n-1;k++){
                        for(l=k+1;l<=n;l++){
                            if(j+k+l==x){
                                count += 1;
                            }
                        }
                    }
                }
                System.out.println(count);
            } 
        }
    }
}


Compiler output:
Main.java:3: error: <identifier> expected
    pubilc static void main(String[] args){
          ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scaner sc=new Scanner(System.in);
        int i,j,k,l,n,x,count=0;
        for(i=0;;i++){
            n=sc.nextInt();
            x=sc.nextInt();
            if((n==0)&&(x==0)){
                break;
            }else{
                for(j=1;j<=n-2;j++){
                    for(k=j+1;k<=n-1;k++){
                        for(l=k+1;l<=n;l++){
                            if(j+k+l==x){
                                count += 1;
                            }
                        }
                    }
                }
                System.out.println(count);
            } 
        }
    }
}


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

import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while(sc.hasNext()){
            int n = sc.nextInt();
            int x = sc.nextInt();
            int count=0;

            if (n==0&&x==0)
                break;

            for (int i=1; i<=n; i++){
                for (int j=i+1; j<=n; j++){
                    for (int k=j+1; k<=n; k++){
                        if (i+j+k==x)
                            count++;
                    }
                }
            }
            System.out.println(count);
        }

    }
}



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

import java.util.Scanner;
public class main {
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int n,x,a=0;
            n = sc.nextInt();
            x = sc.nextInt();
            for(int i=1;i<n-1;i++){
                for(int j=i+1;j<n;j++){
                    int c = x - i - j;
                    if(c>j&&c<=n){
                        a++;
                    }
                }
            }
            System.out.println(a);
        }
    }
}



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

import java.util.Scanner;
public class main{
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int n,x,a=0;
            n = sc.nextInt();
            x = sc.nextInt();
            for(int i=1;i<n-1;i++){
                for(int j=i+1;j<n;j++){
                    int c = x - i - j;
                    if(c>j&&c<=n){
                        a++;
                    }
                }
            }
            System.out.println(a);
        }
    }
}



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