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


import java.util.*;


public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				r += d;
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck<0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	}

}


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

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

while(1){
int m,f,r;
cin>>m>>f>>r;
if(m==-1 && f==-1 && r==-1)break;

if(m==-1 || f==-1){
cout<<"F"<<endl;
}else{
int q=m+f;
 if( q>=80 ){
  cout<<"A"<<,endl;
 }else if( q>=65 && q<80 ){
  cout<<"B"<<endl;
 }else if( q>=50 && q<65 ){
  cout<<"C"<<endl;
 }else if( q>=30 && q<50 ){
  if(r>=50)cout<<"C"<<endl;
  if(r<50)cout<<"D"<<endl;
 }else if(q<30){
  cout<<"F"<<endl;
 }
}
}

}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected primary-expression before ',' token
   15 |   cout<<"A"<<,endl;
      |              ^
Language: C++

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

int main()
{
	while (true)
	{
		int m, f, r;
		cin >> m >> f >> r;

		if (m < 0 && f < 0 && r < 0)
		{
			break;
		}
		
		if (m < 0 || f < 0)
		{
			cout << "F";
		}
		else
		{
			if (m + f >= 80)
			{
				cout << "A";
			}
			else if (m + f >= 65)
			{
				cout << "B";
			}
			else if (m + f >= 50)
			{
				cout << "C";
			}
			else if (m + f >= 30)
			{
				if (r >= 50)
				{
					cout << "C";
				}
				else
				{
					cout << "D";
				}
			}
			else
			{
				cout << "F";
			}
		}
		cout << endl;
	}
}


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

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

int main() {
    int m[50], f[50], r[50], c = 0;
    while(1){
        cin >> m[c] >> f[c] >> r[c];
        if(m[c] == -1 && f[c] == -1 && r[c] == -1) break;
        c++;
    }
    for(int i = 0; i < c + 1; i++){
        if(m[i] == -1 || f[i] == -1){
            cout << "F" << endl;
        } else if(m[i] + f[i] >= 80) {
            cout << "A" << endl;
        } else if(m[i] + f[i] >= 65 && m[i] + f[i] < 80){
            cout << "B" << endl;
        } else if(m[i] + f[i] >= 50 && m[i] + f[i] < 65){
            cout << "C" << endl;
        } else if(m[i] + f[i] >= 30 && m[i] + f[i] < 50){
            if(r >= 50) {
                cout << "C" << endl;
            } else {
                cout << "D" << endl;
            }
        } else {
            cout << "F" << endl;
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |             if(r >= 50) {
      |                ~~^~~~~
Language: C++

int main(){
	int m,f,r ,x;
	
	do{
		cin >>m >>f >>r;
		x= m+f;
		if(m ==-1 && f ==-1 && r == -1) break;
		else if(m == -1|| f ==-1){
			cout <<'F'<<"\n";
		}
		else if(x >=80){
			cout<<'A'<<"\n";
		}
		else if(x>=65 &&x<80){
			cout <<'B'<<"\n";
		}
		else if(x >=50 && x<65){
			cout<<'C'<<"\n";
		}
		else if(x>=30 && x<50){
			if(r>=50){
				cout<<'C'<<"\n";
			}
			else{
				cout<<'D'<<"\n";
			}
		}
		else if(0<x &&x<30){
			cout<<'F'<<"\n";
		}
		

	}while(m !=-1 || r!=-1 ||f !=-1);
	
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope
    5 |                 cin >>m >>f >>r;
      |                 ^~~
a.cc:9:25: error: 'cout' was not declared in this scope
    9 |                         cout <<'F'<<"\n";
      |                         ^~~~
a.cc:12:25: error: 'cout' was not declared in this scope
   12 |                         cout<<'A'<<"\n";
      |                         ^~~~
a.cc:15:25: error: 'cout' was not declared in this scope
   15 |                         cout <<'B'<<"\n";
      |                         ^~~~
a.cc:18:25: error: 'cout' was not declared in this scope
   18 |                         cout<<'C'<<"\n";
      |                         ^~~~
a.cc:22:33: error: 'cout' was not declared in this scope
   22 |                                 cout<<'C'<<"\n";
      |                                 ^~~~
a.cc:25:33: error: 'cout' was not declared in this scope
   25 |                                 cout<<'D'<<"\n";
      |                                 ^~~~
a.cc:29:25: error: 'cout' was not declared in this scope
   29 |                         cout<<'F'<<"\n";
      |                         ^~~~
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;

int main(){
    int m, f, r;
    while(true){
        scanf("%d %d %d", &m, &f, &r);
        if(m == -1 && f == -1 && r == -1) break;
        if(m == -1 || f == -1) {
            printf("F\n");
        }
        if(m + f >= 80){
            printf("A\n");
        } else if(m + f < 80 && m + f >= 65){
            printf("B\n");
        } else if(m + f < 65 && m + f >= 50){
            printf("C\n");
        } else if(m + f < 50 && m + f >= 30){
            if(r >= 50){
                printf("C\n");
            } else if(r < 50){
                printf("D\n");
        } else if(m + f < 30){
            printf("F\n");
        }
    }
    return 0;
}


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

#include <iostream>
using namespace std;

char getGrade(int m, int f, int r){
  int sum=m+f;
  char grade;
  if(m==-1||f==-1){
    grade='F';
  }else if(80 <= sum){
    grade='A';
  }else if(65 <= sum && sum<80){
    grade='B';
  }else if(50 <sum && sum<65){
    grade='C';
  }else if(30<=sum&& sum<50){
    if(59<=r)grade='C';
    else grade='D';
  }else if(sum<30){
    grade='F';
  }
  return grade;
}
int main(){
  int m, f, r;
  while(1);
    cin>>m>>f>>r;
    if(m==-1 && f==-1; r==-1)break;
    cout<<getGrade(m, f, r)<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:30: error: break statement not within loop or switch
   27 |     if(m==-1 && f==-1; r==-1)break;
      |                              ^~~~~
a.cc: At global scope:
a.cc:30:3: error: expected unqualified-id before 'return'
   30 |   return 0;
      |   ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

char getGrade(int m, int f, int r){
  int sum=m+f;
  char grade;
  if(m==-1||f==-1){
    grade='F';
  }else if(80 <= sum){
    grade='A';
  }else if(65 <= sum && sum<80){
    grade='B';
  }else if(50 <=sum && sum<65){
    grade='C';
  }else if(30<=sum && sum<50){
    if(50<=r) grade='C';
    else grade='D';
  }else if(sum<30){
    grade='F';
  }
  return grade;
}
int main(){
  int m, f, r;
  while(1);
    cin>>m>>f>>r;
    if(m==-1 && f==-1; r==-1)break;
    cout<<getGrade(m, f, r)<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:30: error: break statement not within loop or switch
   27 |     if(m==-1 && f==-1; r==-1)break;
      |                              ^~~~~
a.cc: At global scope:
a.cc:30:3: error: expected unqualified-id before 'return'
   30 |   return 0;
      |   ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

char getGrade(int m, int f, int r){
  int sum = m + f;
  char grade;
  if(m == -1 || f == -1){
    grade ='F';
  }else if(80 <= sum){
    grade = 'A';
  }else if(65 <= sum && sum < 80){
    grade = 'B';
  }else if(50 <= sum && sum < 65){
    grade = 'C';
  }else if(30 <= sum && sum < 50){
    if(50 <= r) grade='C';
    else grade = 'D';
  }else if(sum<30){
    grade = 'F';
  }
  return grade;
}
int main(){
  int m, f, r;
  while(1);
    cin >> m >> f >> r;
    if(m == -1 && f == -1; r == -1)break;
    cout << getGrade(m, f, r)<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:36: error: break statement not within loop or switch
   27 |     if(m == -1 && f == -1; r == -1)break;
      |                                    ^~~~~
a.cc: At global scope:
a.cc:30:3: error: expected unqualified-id before 'return'
   30 |   return 0;
      |   ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

char getGrade(int m, int f, int r){
  int sum = m + f;
  char grade;
  if(m == -1 || f == -1){
    grade ='F';
  }else if(80 <= sum){
    grade = 'A';
  }else if(65 <= sum && sum < 80){
    grade = 'B';
  }else if(50 <= sum && sum < 65){
    grade = 'C';
  }else if(30 <= sum && sum < 50){
    if(50 <= r) grade='C';
    else grade = 'D';
  }else if(sum < 30){
    grade = 'F';
  }
  return grade;
}

int main(){
  int m, f, r;
  while(1);
    cin >> m >> f >> r;
    if(m == -1 && f == -1 && r == -1)break;
    cout << getGrade(m, f, r)<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:38: error: break statement not within loop or switch
   28 |     if(m == -1 && f == -1 && r == -1)break;
      |                                      ^~~~~
a.cc: At global scope:
a.cc:31:3: error: expected unqualified-id before 'return'
   31 |   return 0;
      |   ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

char getGrade(int m, int f, int r){
  int sum = m + f;
  char grade;
  if(m == -1 || f == -1){
    grade ='F';
  }else if(80 <= sum){
    grade = 'A';
  }else if(65 <= sum && sum < 80){
    grade = 'B';
  }else if(50 <= sum && sum < 65){
    grade = 'C';
  }else if(30 <= sum && sum < 50){
    if(50 <= r) grade='C';
    else grade = 'D';
  }else if(sum < 30){
    grade = 'F';
  }
  return grade;
}

int main(){
  int m, f, r;
  while(1);
    cin >> m >> f >> r;
    if(m == -1 && f == -1 && r == -1)break;
    cout << getGrade(m, f, r) << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:38: error: break statement not within loop or switch
   28 |     if(m == -1 && f == -1 && r == -1)break;
      |                                      ^~~~~
a.cc: At global scope:
a.cc:31:3: error: expected unqualified-id before 'return'
   31 |   return 0;
      |   ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

char getGrade(int m, int f, int r){
  int sum = m + f;
  char grade;
  if(m == -1 || f == -1){
    grade ='F';
  }else if(80 <= sum){
    grade = 'A';
  }else if(65 <= sum && sum < 80){
    grade = 'B';
  }else if(50 <= sum && sum < 65){
    grade = 'C';
  }else if(30 <= sum && sum < 50){
    if(50 <= r) grade='C';
    else grade = 'D';
  }else if(sum < 30){
    grade = 'F';
  }
  
  return grade;
}

int main(){
  int m, f, r;
  while(1);
    cin >> m >> f >> r;
    if(m == -1 && f == -1 && r == -1)break;
    cout << getGrade(m, f, r) << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:38: error: break statement not within loop or switch
   29 |     if(m == -1 && f == -1 && r == -1)break;
      |                                      ^~~~~
a.cc: At global scope:
a.cc:33:3: error: expected unqualified-id before 'return'
   33 |   return 0;
      |   ^~~~~~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
char getGrade(int m, int f, int r){
int sum = m + f;
char grade;
if(m == -1 || f == -1){
grade ='F';
}else if(80 <= sum){
grade = 'A';
}else if(65 <= sum && sum < 80){
grade = 'B';
}else if(50 <= sum && sum < 65){
grade = 'C';
}else if(30 <= sum && sum < 50){
if(50 <= r) grade='C';
else grade = 'D';
}else if(sum < 30){
grade = 'F';
}
return grade;
}
int main(){
int m, f, r;
while(1);
cin >> m >> f >> r;
if(m == -1 && f == -1 && r == -1)break;
cout << getGrade(m, f, r) << endl;
} 
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:34: error: break statement not within loop or switch
   26 | if(m == -1 && f == -1 && r == -1)break;
      |                                  ^~~~~
a.cc: At global scope:
a.cc:29:1: error: expected unqualified-id before 'return'
   29 | return 0;
      | ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

char getGrade(int m, int f, int r){
  int sum = m + f;
  char grade;
  if(m == -1 || f == -1){
    grade ='F';
  }else if(80 <= sum){
    grade = 'A';
  }else if(65 <= sum && sum < 80){
    grade = 'B';
  }else if(50 <= sum && sum < 65){
    grade = 'C';
  }else if(30 <= sum && sum < 50){
    if(50 <= r){
    grade='C';
    }else{
      grade = 'D';
    }
  }else if(sum < 30){
    grade = 'F';
  }
  
  return grade;
}

int main(){
  int m, f, r;
  while(1);
    cin >> m >> f >> r;
    if(m == -1 && f == -1 && r == -1)break;
    cout << getGrade(m, f, r) << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:38: error: break statement not within loop or switch
   32 |     if(m == -1 && f == -1 && r == -1)break;
      |                                      ^~~~~
a.cc: At global scope:
a.cc:36:3: error: expected unqualified-id before 'return'
   36 |   return 0;
      |   ^~~~~~
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int i, j, s, m[50], f[50], r[50];
    i = 0;
    j = 0;
    
    while(1){
        cin >> m[i] >> f[i] >> r[i];
        if((m[i] == -1) && (m[i] == -1) && (m[i] == -1)) break;
        i++;
    }
    
    while(j < i){
        if((m[j] == -1) || (f[j] == -1)){
            cout << "F" << endl;
        }
        else{
            s = m[j] + f[j]
            if(s >= 80){
                cout << "A" << endl;
            }
            else if((65 <= s) && (s < 80)){
                cout << "B" << endl;
            }
            else if((50 <= s) && (s < 65)){
                cout << "C" << endl;
            }
            else if((30 <= s) && (s < 50)){
                if(r[j] >= 50){
                    cout << "C" << endl;
                }
                else{
                    cout << "D" << endl;
                }
            }
            else if(s < 30){
                cout << "F" << endl;
            }
        }
        j++;
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: expected ';' before 'if'
   20 |             s = m[j] + f[j]
      |                            ^
      |                            ;
   21 |             if(s >= 80){
      |             ~~              
a.cc:24:13: error: 'else' without a previous 'if'
   24 |             else if((65 <= s) && (s < 80)){
      |             ^~~~
Language: C++

#include<stdio.h>
int main(void){

	int m,f,r;
	
	for(;;){
			
			scanf("%d %d %d",&m,&f,&r);

			if(m==-1&&f==-1&&r==-1){
				
				break;

			}

			if(m == -1 || f == -1){
				
				printf("F\n");

			}else if(m + f >= 80){
				
				printf("A\n");

			}else if(m + f >= 65){
				
				printf("B\n");
				
			}else if(m + f >= 50){
				
				printf("C\n");
				
			}else if(m + f >= 30 || r >= 50){
				
				printf("D\n");

			}else{
				
				printf("F\n"):

			}

	}

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:46: error: expected ';' before ':' token
   38 |                                 printf("F\n"):
      |                                              ^
      |                                              ;
Language: C++

include <stdio.h>
int main(void){
int m=0,f=0,r;
while(scanf("%d %d %d", &m, &f, &r)!=EOF){
    int s = m + f;
    if(m == -1 && f == -1 && r == -1){ 
      break;
  }
    if(m==-1 || f==-1){
        printf("F");
    }
  
    else if (s>=80){
      printf("A");
  }
    else if(65<=s&&s<80){
      printf("B");
  }
    else if(50<=s||r>=50){
      printf("C");
  }    
    else if(30<=s&&s<50){
      printf("D");
  }
    else if(s<30){
      printf("F");
  }
    printf("\n");

    return(0);
}



Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int man() {

	int m = 0, f = 0, r = 0, sum;
	char rank;

	while ((m & f & r) != -1) {
		cin >> m >> f >> r;
		if ((m | f) < 0) {
			rank = 'F';
		} else {
			sum = m + f;
			if (sum < 30) {
				rank = 'F';
			} else if (sum < 50) {
				rank = 'D';
				if (r >= 50)
					rank = 'C';
			} else if (sum < 65) {
				rank = 'C';
			} else if (sum < 80) {
				rank = 'B';
			} else {
				rank = 'A';
			}
		}
		cout << rank << endl;
	}

	return 0;
}

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

#include <iostream>
using namespace std;

int main() {

	int m = 0, f = 0, r = 0, sum;
	char rank;

	while (true) {
		cin >> m >> f >> r;

		if ((m & f & r) = -1)
			break;

		if (m < 0 || f < 0) {
			rank = 'F';
		} else {
			sum = m + f;
			if (sum < 30) {
				rank = 'F';
			} else if (sum < 50) {
				rank = 'D';
				if (r >= 50)
					rank = 'C';
			} else if (sum < 65) {
				rank = 'C';
			} else if (sum < 80) {
				rank = 'B';
			} else {
				rank = 'A';
			}
		}
		cout << rank << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: lvalue required as left operand of assignment
   12 |                 if ((m & f & r) = -1)
      |                     ~~~~~~~^~~~
Language: C++

include<cstdio>

int main(){
  int m,f,r,p;
  while(1){
    if(m == -1 && f == -1 && r == -1) break;
    scanf("%d %d %D",&m,&f,&r);
    p = m + f;
    if(m == -1 || f == -1){
      printf("F\n");
    }else if(p >= 80){
      printf("A\n");
    }else if(65 <= p && p < 80){
      printf("B\n");
    }else if(50 <= p && p < 65 || r >= 50){
	printf("C\n");
    }else if(30 <= p && p < 50){
      printf("D\n");
    }else if(p < 30){
      printf("F\n");
      }
      }
  }

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<cstdio>
      | ^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int m, f, r;
	cin >> m >> f >> r;
	while(1){
	if(m=-1 && f=-1 && r=-1){break;}
	if else(m=-1 || f=-1){
	cout << "F" << "\n";
	}if else(m+f>=80){
	cout << "A" << "\n";
	}if else(m+f>=65 && m+f<80){
	cout << "B" << "\n";
	}if else(m+f>=50 && m+f<65){
	cout << "C" << "\n";
	}if else(m+f>=30 && m+f<50){
	cout << "D" << "|n";
	}if else(m+f>=30 && m+f<50 && r>=50){
	cout << "C" << "\n";
	}else{cout << "F" << "\n";
	}
	}
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: lvalue required as left operand of assignment
    8 |         if(m=-1 && f=-1 && r=-1){break;}
      |                      ~~~^~~~
a.cc:9:12: error: expected '(' before 'else'
    9 |         if else(m=-1 || f=-1){
      |            ^~~~
      |            (
a.cc:11:13: error: expected '(' before 'else'
   11 |         }if else(m+f>=80){
      |             ^~~~
      |             (
a.cc:13:13: error: expected '(' before 'else'
   13 |         }if else(m+f>=65 && m+f<80){
      |             ^~~~
      |             (
a.cc:15:13: error: expected '(' before 'else'
   15 |         }if else(m+f>=50 && m+f<65){
      |             ^~~~
      |             (
a.cc:17:13: error: expected '(' before 'else'
   17 |         }if else(m+f>=30 && m+f<50){
      |             ^~~~
      |             (
a.cc:19:13: error: expected '(' before 'else'
   19 |         }if else(m+f>=30 && m+f<50 && r>=50){
      |             ^~~~
      |             (
a.cc:21:10: error: 'else' without a previous 'if'
   21 |         }else{cout << "F" << "\n";
      |          ^~~~
Language: C++

 #include <iostream>
    using namespace std;
     
    int main() {
int m,f,r ;
while (1){
cin >> m >> f >> r;
if (m == -1 && f == -1 && r == -1){
	break;
};
if (m == -1 || f == -1){
	cout << "F" << endl;
}
else if ( m + f >=80){
	cout << "A" << endl;
}
else if ( m + f >=65){
	cout << "B" << endl;
}
else if ( m + f >=50){
	cout << "C" << endl;
}
else if ( m + f >=30){
	if ( r >= 50){
		cout << "C" << endl;
	}
	else {
		cout << "D" << endl;
	}
}
else {
	cout << "F"<< endl;
}
    return 0;
    }

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

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

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

  int m,f,r,b;

  while(1){

    cin >>m>>f>>r;
    b=m+f;

    if(m == -1 && f == -1 && r == -1) break;

    if( b  >= 80 && m != -1 && f != -1){
      cout <<"A\n";
    }else if( b  >= 65 && b < 80 && m != -1 && f != -1){
      cout <<"B\n";
    }else if( ( b >= 50 && b  < 65 ) || r >= 50 && m != -1 && f != -1){
      cout <<"C\n";
    }else if( b >= 30 && b < 50 && m != -1 && f != -1){
      cout <<"D\n";
    }else if( b < 30 || f == -1 || m == -1){
      cout <<"F\n";
    }

  }

}

    

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

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

  int m,f,r;

  while(1){

    cin>>m>>r>>f;

    if(m==-1 |\ f==-1)cout<<"F\n";
    else if(m+f>=80)cout<<"A\n";
    else if(m+f>=65 && m+f<80)cout<<"B";
    else if(m+f>=50 %% m+f>65)cout<<"C";
    if(m+f>=30 && m+f<50){
      if(r>=50)cout<<"C";
      else cout<<"D";
    }  
    else if(m+f<30)cout<<"F";

    if(m==-1 && f==-1 && r==-1)return 0;
  }

}

Compiler output:
a.cc:11:15: error: stray '\' in program
   11 |     if(m==-1 |\ f==-1)cout<<"F\n";
      |               ^
a.cc: In function 'int main()':
a.cc:14:22: error: expected primary-expression before '%' token
   14 |     else if(m+f>=50 %% m+f>65)cout<<"C";
      |                      ^
Language: C++

#include<stdio.h>

int main(void)
{
    int m, f, r;
    scanf("%d %d %d", &m, &f, &r);
    while(! (( m == -1 ) && ( f == -1 ) && ( r == -1))){
        if( ( m + f ) >= 80 ){
            printf("A\n");
        }else if( ( m + f ) >= 60){
            printf("B\n");
        }else if( ( m + f ) >= 50){
            printf("C\n");
        }else if( ( m + f ) >= 30){
            if( r >= 50 ){
                printf("C\n");
            }else{
                printf("D\n");
            }
        }else{
            printf("F\n");
        }
      0  scanf("%d %d %d", &m, &f, &r);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: expected ';' before 'scanf'
   23 |       0  scanf("%d %d %d", &m, &f, &r);
      |        ^ ~~~~~
      |        ;
Language: C++

#include<stdio.h>

int main(void)
{
    int m, f, r;
    scanf("%d %d %d", &m, &f, &r);
    while(! (( m == -1 ) && ( f == -1 ) && ( r == -1))){
        if( ( m + f ) >= 80 ){
            printf("A\n");
        }else if( ( m + f ) >= 65){
            printf("B\n");
        }else if( ( m + f ) >= 50){
            printf("C\n");
        }else if( ( m + f ) >= 30){
            if( r >= 50 ){
                printf("C\n");
            }else{
                printf("D\n");
            }
        }else40
        {
            printf("F\n");
        }
        scanf("%d %d %d", &m, &f, &r);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'else40' was not declared in this scope
   20 |         }else40
      |          ^~~~~~
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            int n = scanner.nextInt();
            int x = scanner.nextInt();
            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:19: error: cannot find symbol
        System.out.println(count);
                           ^
  symbol:   variable count
  location: class Main
1 error
Language: Java

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


Compiler output:
Main.java:19: error: 'else' without 'if'
                         else{
                         ^
1 error
Language: Java

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

		int num = 0;

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

			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)
							num++;
					}
				}
			}
			if (n == 0 && x == 0)
				break;

		}
		System.out.println(num);

	}

}

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

public class Main {

	public static void main(String[] args) {
		//入力導入部
		Scanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		for(;;){
			int n=sc.nextInt();
			int x=sc.nextInt();
			if(n==0&&x==0)break;
			///////////////////////////////////////////////////////////////////
			//計算部			x=n+n-i+n-l
			int count=0;
			for(int i=1;3*i+3<=n;i++){
				for(int l=i+1;i+2l+1<=n;l++){
					for(int s=l+1;s+i+l<=n;s++)
						if(x==n+i+l){
						count++;
					}
				}
			}System.out.println(count);
		}
		}
	}

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

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

/**
 * Lesson7B 1 から n までの数の中から、重複無しで３つの数を
 * 選びそれらの合計が x となる組み合わせ の数を求めるプログラム
 * 例えば、1 から * 5 までの数から３つを選んで
 * それらの合計が 9 となる組み合わせは、
 * ?1 + 3 + 5 = 9
 * ?2 + 3 + 4 = 9
 * の２通りがあります。
 *
 * @author Internship
 *
 */
public class class{

	/**
	 * プログラムのエントリポイント
	 *
	 * @param args
	 */
	public static void main(String[] args) {

		// 答え
		ArrayList<Integer> intAryAnswer = new ArrayList<Integer>();

		// 1列づつ読み込む
		try {
			BufferedReader insBR = new BufferedReader(
					new InputStreamReader(System.in));

			//２つの値が決まった時、残りの3つ目を初期化
			int intThird = 0;

			int intAnswer = 0;

			while (true) {
				String strLine = insBR.readLine();

				//終了条件
				if(strLine.equals("0 0")) {
					break;
				}
				// ばらけさせる
				String[] strAryLine = strLine.split(" ");

				//nの値
				int intN = Integer.parseInt(strAryLine[0]);

				//xの値
				int intX = Integer.parseInt(strAryLine[1]);

				//3
				//12 13 23
				//4
				//12 13 14 23 34

				for(int i = intN; i > 0 ; i--) {
					for(int j = i - 1; j > 0; j--) {
						intThird = intX - i - j;
						if(intThird <= intN &&
								intThird != i &&
								intThird != j &&
								0 < intThird &&
								intThird < j
								) {
							intAnswer++;
						}
					}
				}

				intAryAnswer.add(intAnswer);
				intAnswer = 0;
			}

			//出力
			int intsize = intAryAnswer.size();
			for(int i = 0; i < intsize; i++) {
				System.out.println(intAryAnswer.get(i));
			}

		} catch (IOException e) {
			System.out.println(e);
		} catch(NumberFormatException e) {
			System.out.println("数字で入力して下さい");
		}
	}
}

Compiler output:
Main.java:18: error: <identifier> expected
public class class{
            ^
Main.java:18: error: <identifier> expected
public class class{
                  ^
2 errors
Language: Java

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

/**
 * Lesson7B 1 から n までの数の中から、重複無しで３つの数を
 * 選びそれらの合計が x となる組み合わせ の数を求めるプログラム
 * 例えば、1 から * 5 までの数から３つを選んで
 * それらの合計が 9 となる組み合わせは、
 * ?1 + 3 + 5 = 9
 * ?2 + 3 + 4 = 9
 * の２通りがあります。
 *
 * @author Internship
 *
 */
public class Lesson7B {

	/**
	 * プログラムのエントリポイント
	 *
	 * @param args
	 */
	public static void main(String[] args) {

		// 答え
		ArrayList<Integer> intAryAnswer = new ArrayList<Integer>();

		int intAnswerCount = 0;

		// 1列づつ読み込む
		try {
			BufferedReader insBR = new BufferedReader(
					new InputStreamReader(System.in));

			//２つの値が決まった時、残りの3つ目を初期化
			int intThird = 0;

			int intAnswer = 0;

			while (true) {
				String strLine = insBR.readLine();

				//終了条件
				if(strLine.equals("0 0")) {
					break;
				}
				// ばらけさせる
				String[] strAryLine = strLine.split(" ");

				//nの値
				int intN = Integer.parseInt(strAryLine[0]);

				//xの値
				int intX = Integer.parseInt(strAryLine[1]);

				//3
				//12 13 23
				//4
				//12 13 14 23 34

				for(int i = intN; i > 0 ; i--) {
					for(int j = i - 1; j > 0; j--) {
						intThird = intX - i - j;
						if(intThird <= intN &&
								intThird != i &&
								intThird != j &&
								0 < intThird &&
								intThird < j
								) {
							intAnswer++;
						}
					}
				}

				intAryAnswer.add(intAnswer);
				intAnswer = 0;
				intAnswerCount++;

			}

			//出力
//			int intsize = intAryAnswer.size();
			for(int i = 0; i < intAnswerCount; i++) {
				System.out.println(intAryAnswer.get(i));
			}

		} catch (IOException e) {
			System.out.println(e);
		} catch(NumberFormatException e) {
			System.out.println("数字で入力して下さい");
		}
	}
}

Compiler output:
Main.java:18: error: class Lesson7B is public, should be declared in a file named Lesson7B.java
public class Lesson7B {
       ^
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,x,y=0;
		while(true){
		n=sc.nextInt();
		x=sc.nextInt();
		if(n==0 && x==0)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+k)==x) && (i<j) && (j<k))
		 {y++;
		 }
		 }
		 }
		 }
		System.out.println(y);
		 y=0;
		} 

Compiler output:
Main.java:21: error: reached end of file while parsing
		} 
		 ^
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 {
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         int n, x, ways, ans;
         while(true){ 
             String[] num = in.readLine().split(" ");  
             n = Integer.parseInt(num[0]);
             x = Integer.parseInt(num[1]);
             if(i==0 && j==0 k==0){
                 break;
             }
             for(int i=1; i<=n; i+=1){
                 for(int j=1; j<=n; j+=1){
                     for(int k=1; k<=n; k+=1){
                         if(i==j || j==k || i==k){
                             continue;
                         }else if(i+j+k==x){
                             ways++;
                         }
                     }
                 }
             }
             System.out.println(ways/6);
         }
     } 
}

Compiler output:
Main.java:13: error: ')' expected
             if(i==0 && j==0 k==0){
                            ^
Main.java:13: error: not a statement
             if(i==0 && j==0 k==0){
                              ^
Main.java:13: error: ';' expected
             if(i==0 && j==0 k==0){
                                 ^
3 errors
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 {
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         int n, x, ways, ans;
         while(true){ 
             String[] num = in.readLine().split(" ");  
             n = Integer.parseInt(num[0]);
             x = Integer.parseInt(num[1]);
             if(n==0 && x==0){
                 break;
             }
             for(int i=1; i<=n; i+=1){
                 for(int j=1; j<=n; j+=1){
                     for(int k=1; k<=n; k+=1){
                         if(i==j || j==k || i==k){
                             continue;
                         }else if(i+j+k==x){
                             ways++;
                         }
                     }
                 }
             }
             System.out.println(ways/6);
         }
     } 
}

Compiler output:
Main.java:22: error: variable ways might not have been initialized
                             ways++;
                             ^
Main.java:27: error: variable ways might not have been initialized
             System.out.println(ways/6);
                                ^
2 errors
Language: Java

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

public class HowmanyWays {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n, x, ways;
		while (true) {
			ways = 0;
			String[] num = in.readLine().split(" ");
			n = Integer.parseInt(num[0]);
			x = Integer.parseInt(num[1]);
			for (int i = 1; i <= n; i += 1) {
				for (int j = 1; j <= n; j += 1) {
					for (int k = 1; k <= n; k += 1) {
						if (i == j || j == k || i == k) {
							continue;
						} else if (i + j + k == x) {
							ways++;
						}
					}
				}
			}
			System.out.println(ways / 6);
		}
	}
}

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

package aoj;

import java.util.*;

public class Main3 {

	public static void main(String[] args) {
		int n,x;
		int count = 0;
		while(true){
		Scanner scn = new Scanner(System.in);
		String input = scn.nextLine();
		String[] token = input.split(" ");
		n = Integer.parseInt(token[0]);
		x = Integer.parseInt(token[1]);
		if(n == 0 && x == 0) break;
		else{
			for(int i = 1 ; i < n-1 ; i++){
				for(int j = i + 1 ; j < n ; j++){
					for(int k = j ; k <=n ; k++){
						if(i + j + k == x) count++;
					}
				}
			}
		}
		System.out.println(count);
		}

	}

}

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

import java.util.*;

public class Main3 {

	public static void main(String[] args) {
		int n,x;
		int count = 0;
		while(true){
		Scanner scn = new Scanner(System.in);
		String input = scn.nextLine();
		String[] token = input.split(" ");
		n = Integer.parseInt(token[0]);
		x = Integer.parseInt(token[1]);
		if(n == 0 && x == 0) break;
		else{
			for(int i = 1 ; i < n-1 ; i++){
				for(int j = i + 1 ; j < n ; j++){
					for(int k = j + 1 ; k <=n ; k++){
						if(i + j + k == x) {
							count++;
							break;
						}
					}
				}
			}
		}
		System.out.println(count);
		}

	}

}

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

import java.util.*;

public class MAIN{

	public static void main(String[] args) {
		int n,x,c;
		while(true){
		c = 0;	
		Scanner scn = new Scanner(System.in);
		String inl = scn.nextLine();
		String[] part = inl.split(" ");
		n = Integer.parseInt(part[0]);
		x = Integer.parseInt(part[1]);
		if(n == 0 && x == 0) break;
			else{
				for(int i = 1 ; i < n - 1 ; i++){
					for(int j = i + 1 ; j < n ; j++){
						for(int k = j + 1 ; k <= n ; k++){
							if(i + j + k == x) {
								c++;
							}
						}
					}
				}
			
			}
		}
	System.out.println(c);
	}
}

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

import static java.lang.Integer.parseInt;

public class HowManyWays {
	public static void main(String[] args){
		int n,x,i,a,b,c,num;	//i?????????????????????????????????????????????num????????¶???????????????????????????????????°????¨???¶???????????°
		
		i = 0;
		
		while(parseInt(args[i]) != 0){
			n = parseInt(args[i]);
			x = parseInt(args[i+1]);
			num = 0;
			
			for(a=1; a<=n; a++){
				
				for(b=1; b<=n; b++){
					if(b==a){ continue; }
				
					for(c=1; c<=n; c++){
						if(c==a || c==b){
							continue;
						}else if(a+b+c == x){
							num++;
						}
					}
				}
			}
			System.out.println(num/6);	//a,b,c?????¨?????????????????????????????????3!=6??????????????§6??§??????
			i += 2;
		}
	}
}

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

public class HowManyWays {
	public static void main(String[] args){
		int n,x,i,a,b,c,num;	//i?????????????????????????????????????????????num????????¶???????????????????????????????????°????¨???¶???????????°
		
		i = 0;
		
		while(Integer.parseInt(args[i]) != 0){
			n = Integer.parseInt(args[i]);
			x = Integer.parseInt(args[i+1]);
			num = 0;
			
			for(a=1; a<=n; a++){
				
				for(b=1; b<=n; b++){
					if(b==a){ continue; }
				
					for(c=1; c<=n; c++){
						if(c==a || c==b){
							continue;
						}else if(a+b+c == x){
							num++;
						}
					}
				}
			}
			System.out.println(num/6);	//a,b,c?????¨?????????????????????????????????3!=6??????????????§6??§??????
			i += 2;
		}
	}
}

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

import static java.lang.Integer.parseInt;public class HowManyWays {public static void main(String[] args){int n,x,i,a,b,c,num;i = 0;while(parseInt(args[i]) != 0){n = parseInt(args[i]);x = parseInt(args[i+1]);num = 0;for(a=1; a<=n; a++){for(b=1; b<=n; b++){if(b==a){ continue; }
      for(c=1; c<=n; c++){
      if(c==a || c==b){
       continue;
      }else if(a+b+c == x){
       num++;
      }
     }
    }
   }
   System.out.println(num/6);	i += 2;
  }
 }
}

Compiler output:
Main.java:1: error: class HowManyWays is public, should be declared in a file named HowManyWays.java
import static java.lang.Integer.parseInt;public class HowManyWays {public static void main(String[] args){int n,x,i,a,b,c,num;i = 0;while(parseInt(args[i]) != 0){n = parseInt(args[i]);x = parseInt(args[i+1]);num = 0;for(a=1; a<=n; a++){for(b=1; b<=n; b++){if(b==a){ continue; }
                                                ^
1 error
Language: Java

import static java.lang.Integer.parseInt;

public class HowManyWays {
	public static void main(String[] args){
		int n,x,i,a,b,c,num;	
		
		i = 0;
		
		while(parseInt(args[i]) != 0){
			n = parseInt(args[i]);
			x = parseInt(args[i+1]);
			num = 0;
			
			for(a=1; a<=n; a++){
				
				for(b=1; b<=n; b++){
					if(b==a){ continue; }
				
					for(c=1; c<=n; c++){
						if(c==a || c==b){
							continue;
						}else if(a+b+c == x){
							num++;
						}
					}
				}
			}
			System.out.println(num/6);	
			i += 2;
		}
	}
}

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 Itp1_7_b {
    public static void main(String[] args) {

        while (true) {
            String[] ary = new Scanner(System.in).nextLine().split(" ");
            int n = Integer.parseInt(ary[0]);
            int x = Integer.parseInt(ary[1]);

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

            int counter = 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) {
                            counter++;
                        }
                    }
                }
            }

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

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

import java.io.*;
class Main{
public static void main(String[] args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int[] A=new Int[101];
int a=0;
while(true){
String x=br.readLine();
String y=br.readLine();
int n=Integer.parseInt(x);
int m=Integer.parseInt(y);
if(x==0&&y==0)
break;
int sum=0;
for(int i=1;i<=x;i++){
for(int j=i;j<=x;j++){
for(int k=j;k<=x;k++){
if(i+j+k==m)
sum++;
}
}
}
A[a]=sum;
a++;
}
for(int z=0;z<a;z++)
System.out.println(A[z]);
}
}

Compiler output:
Main.java:5: error: cannot find symbol
int[] A=new Int[101];
            ^
  symbol:   class Int
  location: class Main
Main.java:12: error: bad operand types for binary operator '=='
if(x==0&&y==0)
    ^
  first type:  String
  second type: int
Main.java:12: error: bad operand types for binary operator '=='
if(x==0&&y==0)
          ^
  first type:  String
  second type: int
Main.java:15: error: bad operand types for binary operator '<='
for(int i=1;i<=x;i++){
             ^
  first type:  int
  second type: String
Main.java:16: error: bad operand types for binary operator '<='
for(int j=i;j<=x;j++){
             ^
  first type:  int
  second type: String
Main.java:17: error: bad operand types for binary operator '<='
for(int k=j;k<=x;k++){
             ^
  first type:  int
  second type: String
6 errors
Language: Java

import java.util.Scanner;

public class AOJ7_2 {


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

		int n = scan.nextInt();//???????????°???????????????
		int x = scan.nextInt();//???????±?????????°???????????????
		int ans_cnt = 0;

		while(true){
			if(n == 0 && x == 0)
				break;
			for(int cnt1 = 1; cnt1 <= n; cnt1++){
				for(int cnt2 = cnt1 + 1; cnt2 <= n; cnt2++){
					for(int cnt3 = cnt2 +1; cnt3 <= n; cnt3++){
						if(cnt1 + cnt2 + cnt3 == x)
							ans_cnt++;
					}
				}
			}
		System.out.println(ans_cnt);	
		scan.close();
		}
	}
}

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

0import java.io.*;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true) {
            String[] tmp = br.readLine().split(" ");
            int n = Integer.parseInt(tmp[0]);
            int x = Integer.parseInt(tmp[1]);
            if (n == 0 || x == 0) {
                break;
            }
            int count = 0;
            for(int i = 3;i <= n;i++){
                for(int j = 2;j < i;j++){
                    for(int k = 1;k < j;k++){
                        if((i + j + k) == x){
                            count++;
                        }
                    }
                }
            }
            System.out.println(count);
        }
    }
 
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
0import java.io.*;
^
1 error
Language: Java

import java.util.Scanner;

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

		// ?????°??£?¨?
		int n = 0;
		int x = 0;
		int count = 0;

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

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

			// ???????????????
			for ( int i = 0; i <= n; i++ ) {
				for ( int j = i + 1; j <= n; j++ ) {
					for ( int k = j + 1; k <= n; k++ ) {
						count++;
					}
				}
			}
		}

		System.out.println ( count );

	}
}

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

import java.util.Scanner;

class Main{
    public static void main(String[] args){
    	int n,x,max;
    	int count = 0;
    	Scanner sc = new Scanner(System.in);
    	while(true){
    		n = sc.nextInt();
        	x = sc.nextInt();
        	if(n ==0 && x ==0){
        		break;
        	}
        	max = n >= x ? x:n;

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

    }
}import java.util.Scanner;

class Main{
    public static void main(String[] args){
    	int n,x,max;
    	int count = 0;
    	Scanner sc = new Scanner(System.in);
    	while(true){
    		n = sc.nextInt();
        	x = sc.nextInt();
        	if(n ==0 && x ==0){
        		break;
        	}
        	max = n >= x ? x:n;

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

    }
}

Compiler output:
Main.java:31: error: class, interface, enum, or record expected
}import java.util.Scanner;
 ^
1 error