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

#include<iostream>

using namespace std;

int main(){
	//??????????????§????????°????????????????????????????????? = ????????????
	while(true){
		int n;
		cin >> n;
		if (n == 0) break;

		int max_p = 0, max_d = 0;
		for (int i = 0; i < n; i++) {
			int p, d1, d2;
			cin >>p >> d1 >> d2;

			if (max_d <=  d1 + d2) {
				max_d = d1 + d2;
				max_p = p;
			}
		}
		cout << max_p << " " << max_d << endl;
	}

	return 0;

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

#inclue<stdio.h>
int main(void)
{
	int n,max,i,p[10000],d1,d2,d[10000],x;
	while(1){
		max=0;
		scanf("%d",&n);
		if(n==0)break;
		for(i=0;i<n;i++){
			scanf("%d %d %d",&p[i],&d1,&d2);
			d[i]=d1+d2;
		}
		for(i=0;i<n;i++){
			if(max<d[i]){
				max=d[i];
				x=p[i];
			}
		}
		printf("%d %d\n",x,max);
	}
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include?
    1 | #inclue<stdio.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:17: error: 'scanf' was not declared in this scope
    7 |                 scanf("%d",&n);
      |                 ^~~~~
a.cc:19:17: error: 'printf' was not declared in this scope
   19 |                 printf("%d %d\n",x,max);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #inclue<stdio.h>
Language: C++

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

class Point{
public:
  int n,walk;
  Point(int n = 0,int walk = 0):n(n),walk(walk){}
  bool operator < (const Point &s) const{ return walk > s.walk;}
};

int main(){
  int i,j,n;
  while(1){
    Point p[10000];
    cin >> n;
    if(n == 0) break;
    int a,b;
    for(i=0;i<n;i++){
      cin >> p[i].n >> a >> b;
      p[i].walk = a + b;
    }
    sort(p,p+n);
    cout << p[0].n << " " << p[0].walk << endl;

  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |     sort(p,p+n);
      |     ^~~~
      |     short
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,p,d1,d2,maxp,maxv;
	while(1){
		cin >> n
		if(n == 0) break;
		maxp = maxv = 0;
		while(n --){
			cin >> p >> d1 >> d2;
			if(maxv < d1+d2){
				maxp = p;
				maxv = d1+d2;
		}
		cout<< maxp << maxv;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: expected ';' before 'if'
    6 |                 cin >> n
      |                         ^
      |                         ;
    7 |                 if(n == 0) break;
      |                 ~~       
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,p,d1,d2,maxp,maxv;
	while(1){
		cin >> n
		if(n == 0) break;
		maxp = maxv = 0;
		while(n --){
			cin >> p >> d1 >> d2;
			if(maxv < d1+d2){
				maxp = p;
				maxv = d1+d2;
                                }
		}
		cout<< maxp << maxv;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: expected ';' before 'if'
    6 |                 cin >> n
      |                         ^
      |                         ;
    7 |                 if(n == 0) break;
      |                 ~~
Language: C++


using namespace std;
int main(){
	int n,p,d1,d2,maxp,maxv;
	while(1){
		cin >> n;
		if(n == 0) break;
		maxp = maxv = 0;
		while(n --){
			cin >> p >> d1 >> d2;
			if(maxv < d1+d2){
				maxp = p;
				maxv = d1+d2;
				}
		}
		cout<< maxp << maxv;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'cin' was not declared in this scope
    6 |                 cin >> n;
      |                 ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:16:17: error: 'cout' was not declared in this scope
   16 |                 cout<< maxp << maxv;
      |                 ^~~~
a.cc:16:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,p,d1,d2,maxp,maxv;
	while(1){
		cin >> n;
		if(n == 0) break;
		maxp = maxv = -1;
		while(n --){
			cin >> p >> d1 >> d2;
			if(maxv < d1+d2){
				maxp = p;
				maxv = d1+d2;
				}
		}
		cout<< maxp << << maxv;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: expected primary-expression before '<<' token
   16 |                 cout<< maxp << << maxv;
      |                                ^~
Language: Java


import java.util.Scanner;
public class main {
	Scanner sc = new Scanner(System.in);
	int pm,pe,pj;
	double avg1,avg2;
	int nin;
	public void sei(){
		nin = sc.nextInt();
		while(!(nin==0)){
		for(int i = 1;i<=nin;i++){
			pm = sc.nextInt();
			pe = sc.nextInt();
			pj = sc.nextInt();
			if((pm==100)||(pe==100)||(pj==100)){
				System.out.println("A");
			}else{
				avg1 = (pm +pe) / 2;
				if(avg1>=90){
					System.out.println("A");
					}else{
						avg2 = (pm + pe + pj) / 3;
						if(avg2>=80){
							System.out.println("A");
						}else{
							if(avg2>=70){
								System.out.println("B");
							}else{
								if(avg2>=50){
									if((pm>=80)||(pe>=80)){
										System.out.println("B");
									}else{
										System.out.println("C");
									}
								}else{
									System.out.println("C");
								}
							}
						}

				}

			}


		}
		nin = sc.nextInt();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		main a = new main();
		a.sei();
		// TODO 自動生成されたメソッド・スタブ

	}

}

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

package aizu;
import java.util.Scanner;
public class ao {
	Scanner sc = new Scanner(System.in);
	int pm,pe,pj;
	double avg1,avg2;
	int nin;
	public void sei(){
		nin = sc.nextInt();
		while(!(nin==0)){
		for(int i = 1;i<=nin;i++){
			pm = sc.nextInt();
			pe = sc.nextInt();
			pj = sc.nextInt();
			if((pm==100)||(pe==100)||(pj==100)){
				System.out.println("A");
			}else{
				avg1 = (pm +pe) / 2;
				if(avg1>=90){
					System.out.println("A");
					}else{
						avg2 = (pm + pe + pj) / 3;
						if(avg2>=80){
							System.out.println("A");
						}else{
							if(avg2>=70){
								System.out.println("B");
							}else{
								if(avg2>=50){
									if((pm>=80)||(pe>=80)){
										System.out.println("B");
									}else{
										System.out.println("C");
									}
								}else{
									System.out.println("C");
								}
							}
						}

				}

			}


		}
		nin = sc.nextInt();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ao a = new ao();
		a.sei();
		// TODO 自動生成されたメソッド・スタブ

	}

}

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

package aizu;
import java.util.Scanner;
public static void main(String[] args) {
public class ao {
	Scanner sc = new Scanner(System.in);
	int pm,pe,pj;
	double avg1,avg2;
	int nin;
	public void sei(){
		nin = sc.nextInt();
		while(!(nin==0)){
		for(int i = 1;i<=nin;i++){
			pm = sc.nextInt();
			pe = sc.nextInt();
			pj = sc.nextInt();
			if((pm==100)||(pe==100)||(pj==100)){
				System.out.println("A");
			}else{
				avg1 = (pm +pe) / 2;
				if(avg1>=90){
					System.out.println("A");
					}else{
						avg2 = (pm + pe + pj) / 3;
						if(avg2>=80){
							System.out.println("A");
						}else{
							if(avg2>=70){
								System.out.println("B");
							}else{
								if(avg2>=50){
									if((pm>=80)||(pe>=80)){
										System.out.println("B");
									}else{
										System.out.println("C");
									}
								}else{
									System.out.println("C");
								}
							}
						}

				}

			}


		}
		nin = sc.nextInt();
		}
	}

}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
Main.java:4: error: illegal start of expression
public class ao {
^
Main.java:1: error: unnamed class should not have package declaration
package aizu;
^
3 errors
Language: Java

import java.util.*;
public class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	int n,pm,pe,pj;
	while(stdIn.hasNextInt()){
	    n = stdIn.nextInt();
	    for(int i = 0;i < n;i++){
		pm = stdIn.nextInt();
		pe = stdIn.nextInt();
		pj = stdIn.nextInt();
		if(pm == 100 || pe == 100 || pj == 100){
		    System.out.println("A");
		}else if((pm + pe) / 2 >= 90){
		    System.out.println("A");
		}else if((pm + pe + pj) / 3 >= 80){
		    System.out.println("A");
		}else if((pm + pe + pj) / 3 >= 70){
		    System.out.println("B");
		}else if((pm + pe + pj) / 3 >= 50 && (pm >= 80 || pe >= 80)){
		    System.out.println("B");
		}else System.out.println("C");
	    }
	}
    }

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

#include<iostream>
using namespace std;
int main(){
	int a,a1,a2,a3,i,sum=0,avg=0;
	while(1){
		cin>>a;
		if(a==0) break;
		for(i=0;i<a;i++){
			cin>>a1>>a2>>a3;
			sum=a1+a2+a3;
			avg=sum/3;
			if(a1==100||a2==100||a3==100||avg>=80||(a1+a2)/2>=90||avg>=50&&a1>=80&&a2>=80||avg>=70&&a1>=80||avg>=70&&a2>=80)
				cout<<'A'<<endl;
			else if(avg>=70||avg>=50&&a1>=80||avg>=50&&a2>=80)
				cout<<'B'<<endl;
			else
				cout<<'C'<<endl;
		}
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int sum[7];
int main(void)
{
	int i, j, n;
	int m, e, j;
	float ave;
	
	while (scanf("%d", &n), n != 0){
		for (j = 0; j < n; j++){
			scanf("%d %d %d", &m, &e, &j);
			ave = (m + e + j) / 3.0;
			
			if (m == 100 || e == 100 || j == 100){
				printf("A\n");
			}
			else if ((m + e) / 2.0 >= 90){
				printf("A\n");
			else if (ave >= 80){
				printf("A\n");
			}
			else if (ave >= 70){
				printf("B\n");
			}
			else if (ave >= 50 && (m >= 80||e = 80)){
				printf("B\n");
			}
			else {
				printf("C\n");
			}
		}
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:19: error: redeclaration of 'j' with no linkage
    7 |         int m, e, j;
      |                   ^
main.c:6:16: note: previous declaration of 'j' with type 'int'
    6 |         int i, j, n;
      |                ^
main.c:20:25: error: expected '}' before 'else'
   20 |                         else if (ave >= 80){
      |                         ^~~~
main.c:26:59: error: lvalue required as left operand of assignment
   26 |                         else if (ave >= 50 && (m >= 80||e = 80)){
      |                                                           ^
Language: C

#include <stdio.h>

int sum[7];
int main(void)
{
	int i, _j, n;
	int m, e, j;
	float ave;
	
	while (scanf("%d", &n), n != 0){
		for (_j = 0; _j < n; _j++){
			scanf("%d %d %d", &m, &e, &j);
			ave = (m + e + j) / 3.0;
			
			if (m == 100 || e == 100 || j == 100){
				printf("A\n");
			}
			else if ((m + e) / 2.0 >= 90){
				printf("A\n");
			}
			else if (ave >= 80){
				printf("A\n");
			}
			else if (ave >= 70){
				printf("B\n");
			}
			else if (ave >= 50 && (m >= 80||e = 80)){
				printf("B\n");
			}
			else {
				printf("C\n");
			}
		}
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:59: error: lvalue required as left operand of assignment
   27 |                         else if (ave >= 50 && (m >= 80||e = 80)){
      |                                                           ^
Language: C

#include<stdio.h>
int main(void){
	int n;
	int i;
	int mat,eng,jpn;
	while(scanf("%d",&n)){
		if(n == 0){
			break;
		}
		for(i = 0;i < n;i++){
			scanf("%d %d %d",&mat,&eng,&jpn);
			if(mat == 100 || eng == 100 || jpn == 100 || (mat + eng) / 2 >= 90 || (eng + mat + jpn) / 3 >= 80){
				printf("A\n");
			}
			else if((mat + rng + jpn) / 3 >= 70 || ((mat + eng + jpn) / 3 >= 50 && (mat >= 80 || eng >= 80))){
				printf("B\n");
			}
			else{
				printf("C\n");
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:40: error: 'rng' undeclared (first use in this function); did you mean 'eng'?
   15 |                         else if((mat + rng + jpn) / 3 >= 70 || ((mat + eng + jpn) / 3 >= 50 && (mat >= 80 || eng >= 80))){
      |                                        ^~~
      |                                        eng
main.c:15:40: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
	int ;
	scanf("%d",&n);
	while(n!=0){
		for(i=0;i<n;i++){
			scanf("%d %d %d",&pm,&pe,&pj);
			if(pm==100||pj==100||pe==100||(pe+pm)/2>=90||(pe+pm+pj)/3>=80){
				printf("A\n");
			}
			else if((pe+pm+pj)/3>=70)
				printf("B\n");
			else if((pe+pm+pj)/3>=50){
				if(pm>=80||pe>=80){
					printf("B\n");
				}
			}
			else
				printf("C\n");
		}
		scanf("%d",&n);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: warning: useless type name in empty declaration
    4 |         int ;
      |         ^~~
main.c:5:21: error: 'n' undeclared (first use in this function)
    5 |         scanf("%d",&n);
      |                     ^
main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:21: error: 'i' undeclared (first use in this function)
    7 |                 for(i=0;i<n;i++){
      |                     ^
main.c:8:43: error: 'pm' undeclared (first use in this function)
    8 |                         scanf("%d %d %d",&pm,&pe,&pj);
      |                                           ^~
main.c:8:47: error: 'pe' undeclared (first use in this function)
    8 |                         scanf("%d %d %d",&pm,&pe,&pj);
      |                                               ^~
main.c:8:51: error: 'pj' undeclared (first use in this function)
    8 |                         scanf("%d %d %d",&pm,&pe,&pj);
      |                                                   ^~
Language: C

#include<stdio.h>
int main(void)
{
    int i,a,b[10001],c[10001],d[10001];
	while(1){
	scanf("%d",&a);
	if(a==0) break;
	for(i=0;i<a;i++){
	scanf("%d %d %d",&b[i],&c[i],&d[i]);
	}
	for(i=0;i<a;i++){
	if(b==100||c==100||d==100){
	printf("A\n");
	}
	else if((b+c)/2>=90){
	printf("A\n");
	}
	else if((b+c+d)/3>=80){
	printf("A\n");
	}
	else if((b+c+d)/3>=70){
	printf("B\n");
	}
	else if((b+c+d)/3>=50){
	if(b>=80||c>=80){
	printf("B\n");
	}
	}
	else{
	printf("C\n");
	}
	}
	}
	return 0;
	}

Compiler output:
main.c: In function 'main':
main.c:12:13: warning: comparison between pointer and integer
   12 |         if(b==100||c==100||d==100){
      |             ^~
main.c:12:21: warning: comparison between pointer and integer
   12 |         if(b==100||c==100||d==100){
      |                     ^~
main.c:12:29: warning: comparison between pointer and integer
   12 |         if(b==100||c==100||d==100){
      |                             ^~
main.c:15:19: error: invalid operands to binary + (have 'int *' and 'int *')
   15 |         else if((b+c)/2>=90){
      |                  ~^
      |                  ||
      |                  |int *
      |                  int *
main.c:18:19: error: invalid operands to binary + (have 'int *' and 'int *')
   18 |         else if((b+c+d)/3>=80){
      |                  ~^
      |                  ||
      |                  |int *
      |                  int *
main.c:21:19: error: invalid operands to binary + (have 'int *' and 'int *')
   21 |         else if((b+c+d)/3>=70){
      |                  ~^
      |                  ||
      |                  |int *
      |                  int *
main.c:24:19: error: invalid operands to binary + (have 'int *' and 'int *')
   24 |         else if((b+c+d)/3>=50){
      |                  ~^
      |                  ||
      |                  |int *
      |                  int *
main.c:25:13: warning: comparison between pointer and integer
   25 |         if(b>=80||c>=80){
      |             ^~
main.c:25:20: warning: comparison between pointer and integer
   25 |         if(b>=80||c>=80){
      |                    ^~
Language: C

#include<stdio.h>

int main(void)
{
	int n, i, pm, pe, pj,b[10000];
	char a[3];
	while (1)
	{
		scanf_s("%d", &n);
		if (n == 0)break;
		for (i = 0;i < n;i++)
		{
			scanf_s("%d %d %d", &pm, &pe, &pj);
			if (pm == 100 || pe == 100 || pj == 100)
			{
				printf("A\n");
			}
			else if ((pm + pe) / 2 >= 90)
			{
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 80)
			{
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 70)
			{
				printf("B\n");
			}
			else if ((pm + pe + pj) / 3 >= 50)
			{
				if (pm >= 80 || pe >= 80)
				{
					printf("B\n");
				}
				else
				{
					printf("C\n");
				}
			}
			else
			{
				printf("C\n");
			}
		}

	}
}

Compiler output:
main.c: In function 'main':
main.c:9:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include<stdio.h>

int main(void)
{
	int n, i, pm, pe, pj;
	while (1)
	{
		scanf_s("%d", &n);
		if (n == 0)break;
		for (i = 0;i < n;i++)
		{
			scanf("%d %d %d", &pm, &pe, &pj);
			if (pm == 100 || pe == 100 || pj == 100)
			{
				printf("A\n");
			}
			else if ((pm + pe) / 2 >= 90)
			{
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 80)
			{
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 70)
			{
				printf("B\n");
			}
			else if ((pm + pe + pj) / 3 >= 50)
			{
				if (pm >= 80 || pe >= 80)
				{
					printf("B\n");
				}
				else
				{
					printf("C\n");
				}
			}
			else
			{
				printf("C\n");
			}
		}

	}
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include<stdio.h>

int main(void)
{
	int n, i, pm, pe, pj;

	while (1)
	{
		scanf_s("%d", &n);
		if (n == 0)break;
		for (i = 0;i < n;i++)
		{
			scanf_s("%d %d %d", &pm, &pe, &pj);
			if (pm == 100 || pe == 100 || pj == 100)
			{
				printf("A\n");
			}
			else if ((pm + pe) / 2 >= 90)
			{
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 80)
			{
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 70)
			{
				printf("B\n");
			}
			else if ((pm + pe + pj) / 3 >= 50)
			{
				if (pm >= 80 || pe >= 80)
				{
					printf("B\n");
				}
				else
				{
					printf("C\n");
				}
			}
			else
			{
				printf("C\n");
			}
		}

	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include<stdio.h>
int main(void) {
	int n=0, pm, pe, pj,i=0;
	while (1) {
		scanf_s("%d", &n);
		if (n == 0) break;
		for (i = 0;i < n;i++) {
			scanf_s("%d %d %d", &pm, &pe, &pj);
			if (pm == 100 || pe == 100 || pj == 100) {
				printf("A\n");
			}
			else if ((pm + pe) / 2 >= 90) {
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 80) {
				printf("A\n");
			}
			else if ((pm + pe + pj) / 3 >= 50 && (pm>=80 || pe>=80)) {
				printf("B\n");
			}
			else if ((pm + pe + pj) / 3 >= 70) {
				printf("B\n");
			}
			else {
				printf("C\n");
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include<stdio.h>
int main(void){
	int n,pm,pe,pj,i;
	while(1){
		scanf("%d",&n);
		if(n==0) break;
		for(i=0;i<n;i++){
			scanf("%d %d %d",&pm,&pe,&pj);
			if(pm==100 || pe==100 || pj==100){
				printf("A\n");
			}else if(((pm+pe)/2)>=90){
				printf("A\n");
			}else if(((pm+pe+pj)/3)>=80){
				printf("A\n");
			}else if(((pm+pe+pj)/3)>=70){
				printf("B\n");
			}else if(((pm+pe+pj)/3)>=50 && pm>=80 ||pe>=80){
				printf("B\n");
			}else{
				printf("C\n");
			}
		}
	}
	return 0;

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

#include<stdio.h>
int main(void){
	int n,pm,pe,pj,i;
	while(1){
		scanf("%d",&n);
		if(n==0) break;
		for(i=0;i<n;i++){
			scanf("%d %d %d",&pm,&pe,&pj);
			if(pm==100 || pe==100 || pj==100){
				printf("A\n");
			}else if(((pm+pe)/2)>=90){
				printf("A\n");
			}else if(((pm+pe+pj)/3)>=80){
				printf("A\n");
			}else if(((pm+pe+pj)/3)>=70){
				printf("B\n");
			}else if(((pm+pe+pj)/3)>=50 && pm>=80 || pe>=80){
				printf("B\n");
			}else{
				printf("C\n");
			}
		}
	}
	return 0;

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

#include<string.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
int main() {
	int n;
	int m, e, j;
	while (~fscanf(stdin, "%d", &n), n != 0){
		while (n--) {
			fscanf(stdin, "%d%d%d", &m, &e, &j);
			if (m == 100 || e == 100 || j == 100 || (m + e) / 2 >= 90.0 || (m + e + j) / 3 >= 80.0) puts("A");
			else if ((m + e + j) / 3 >= 70.0 || (((m + e + j) / 3 >= 50.0) && (m >= 80 || e >= 80))) puts("B");
			else puts("C");
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:17: error: implicit declaration of function 'fscanf' [-Wimplicit-function-declaration]
    6 |         while (~fscanf(stdin, "%d", &n), n != 0){
      |                 ^~~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'fscanf'
    1 | #include<string.h>
  +++ |+#include <stdio.h>
    2 | #define P(type,x) fprintf(stdout,"%"#type"\n",x)
main.c:6:17: warning: incompatible implicit declaration of built-in function 'fscanf' [-Wbuiltin-declaration-mismatch]
    6 |         while (~fscanf(stdin, "%d", &n), n != 0){
      |                 ^~~~~~
main.c:6:17: note: include '<stdio.h>' or provide a declaration of 'fscanf'
main.c:6:24: error: 'stdin' undeclared (first use in this function)
    6 |         while (~fscanf(stdin, "%d", &n), n != 0){
      |                        ^~~~~
main.c:6:24: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:6:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:113: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    9 |                         if (m == 100 || e == 100 || j == 100 || (m + e) / 2 >= 90.0 || (m + e + j) / 3 >= 80.0) puts("A");
      |                                                                                                                 ^~~~
main.c:9:113: note: include '<stdio.h>' or provide a declaration of 'puts'
Language: C

#include <stdio.h>

int main()
{
	int i, n, pm, pe, pj;
	float a2, a3;

	scanf("%d", &n);

	for (i=1; i<=n; i++) {
		scanf("%d %d %d", &pm, &pe, &pj);

		a2 = (pm + pe)/2;
		a3 = (pm + pe + pj)/3;

		if	(pm==100 || pe==100 || pj==100 || a2>=90 || a3>=80) printf("A\n");
	  else if (a3>=70 || (a3>=50 && (pm>=80 || pe>=80))	printf("B\n");
		else printf("C\n");
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:64: error: expected ')' before 'printf'
   17 |           else if (a3>=70 || (a3>=50 && (pm>=80 || pe>=80))     printf("B\n");
      |                   ~                                        ^~~~~~~~~~~
      |                                                                )
main.c:19:9: error: expected expression before '}' token
   19 |         }
      |         ^
Language: C++

#include<stdio.h>

void dividing_student(int a, int b, int c);
void finish();

int main(void)
{
    int n;/*nはデータの個数*/
    scanf("%d", &n);
    for( int i = 0; i <= n; ++i){
        if (i < n){
            int pm ,pe, pj; /*左から数学、英語、国語の点数*/
            scanf("%d %d %d", &pm, &pe, &pj);
            dividing_student( pm, pe, pj);
        }else{
            finish();
        }
    
    }/*return 0 いるの？*/
}

void dividing_student( int a, int b, int c)
{
    if( a >= 100|| b >= 100 || c >=100){
        printf("A\n");
    }else if( (a + b) / 2 >= 90){
        printf("A\n");
    }else if( (a + b + c) / 3 >= 80){
        printf("A\n");
    }else if( (a + b + c) / 3 >= 70){
        printf("B\n");
    }else if((a + b + c) / 3 >= 50 && (a >= 50 || b >= 50)){
        printf("B\n");
    }else{
        printf("C\n");
    }
}    
    
void finish()
{
    int n;
    scanf("%d", &n);
    if( n == 0){
        return 0;
    }else{
        for( int i = 0; i <= n; ++i){
            if (i < n){
                int pm ,pe, pj; /*左から数学、英語、国語の点数*/
                scanf("%d %d %d", &pm, &pe, &pj);
                dividing_student( pm, pe, pj);
            }else{
                finish();
            }
         }
    }
}       

Compiler output:
a.cc: In function 'void finish()':
a.cc:44:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   44 |         return 0;
      |                ^
Language: C++

#include <stdio.h>

void judge(int pm, int pe, int pj);

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

void judge(int pm, int pe, int pj)
{
    int sum = pm + pe + pj;
    char class;

    if (pm == 100 || pe == 100 || pj == 100){
        class = 'A';
    } else if (pm + pe >= 180){
        class = 'A';
    } else if (sum >= 160){
        class = 'A';
    } else if (sum >= 140){
        class = 'B';
    } else if (sum >= 100 && (pm >= 80 || pe >= 80)){
        class = 'B';
    } else {
        class = 'C';
    }

    printf("%c\n", class);
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:28:5: error: multiple types in one declaration
   28 |     char class;
      |     ^~~~
a.cc:28:10: error: declaration does not declare anything [-fpermissive]
   28 |     char class;
      |          ^~~~~
a.cc:28:5: error: expected primary-expression before 'char'
   28 |     char class;
      |     ^~~~
a.cc:31:9: error: expected primary-expression before 'class'
   31 |         class = 'A';
      |         ^~~~~
a.cc:33:9: error: expected primary-expression before 'class'
   33 |         class = 'A';
      |         ^~~~~
a.cc:35:9: error: expected primary-expression before 'class'
   35 |         class = 'A';
      |         ^~~~~
a.cc:37:9: error: expected primary-expression before 'class'
   37 |         class = 'B';
      |         ^~~~~
a.cc:39:9: error: expected primary-expression before 'class'
   39 |         class = 'B';
      |         ^~~~~
a.cc:41:9: error: expected primary-expression before 'class'
   41 |         class = 'C';
      |         ^~~~~
a.cc:44:20: error: expected primary-expression before 'class'
   44 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include <stdio.h>

void judge(int pm, int pe, int pj);

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

void judge(int pm, int pe, int pj)
{
    int sum = pm + pe + pj;
    char class;

    if (pm == 100 || pe == 100 || pj == 100){
        class = 'A';
    } else if (pm + pe >= 180){
        class = 'A';
    } else if (sum >= 240){
        class = 'A';
    } else if (sum >= 210){
        class = 'B';
    } else if (sum >= 150 && (pm >= 80 || pe >= 80)){
        class = 'B';
    } else {
        class = 'C';
    }

    printf("%c\n", class);
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:28:5: error: multiple types in one declaration
   28 |     char class;
      |     ^~~~
a.cc:28:10: error: declaration does not declare anything [-fpermissive]
   28 |     char class;
      |          ^~~~~
a.cc:28:5: error: expected primary-expression before 'char'
   28 |     char class;
      |     ^~~~
a.cc:31:9: error: expected primary-expression before 'class'
   31 |         class = 'A';
      |         ^~~~~
a.cc:33:9: error: expected primary-expression before 'class'
   33 |         class = 'A';
      |         ^~~~~
a.cc:35:9: error: expected primary-expression before 'class'
   35 |         class = 'A';
      |         ^~~~~
a.cc:37:9: error: expected primary-expression before 'class'
   37 |         class = 'B';
      |         ^~~~~
a.cc:39:9: error: expected primary-expression before 'class'
   39 |         class = 'B';
      |         ^~~~~
a.cc:41:9: error: expected primary-expression before 'class'
   41 |         class = 'C';
      |         ^~~~~
a.cc:44:20: error: expected primary-expression before 'class'
   44 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include <stdio.h>

void judge(int pm, int pe, int pj);

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

void judge(int pm, int pe, int pj)
{
    int sum;
    sum = pm + pe + pj;
    char class;

    if (pm == 100 || pe == 100 || pj == 100){
        class = 'A';
    } else if (pm + pe >= 180){
        class = 'A';
    } else if (sum >= 240){
        class = 'A';
    } else if (sum >= 210){
        class = 'B';
    } else if (sum >= 150 && (pm >= 80 || pe >= 80)){
        class = 'B';
    } else {
        class = 'C';
    }

    printf("%c\n", class);
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:29:5: error: multiple types in one declaration
   29 |     char class;
      |     ^~~~
a.cc:29:10: error: declaration does not declare anything [-fpermissive]
   29 |     char class;
      |          ^~~~~
a.cc:29:5: error: expected primary-expression before 'char'
   29 |     char class;
      |     ^~~~
a.cc:32:9: error: expected primary-expression before 'class'
   32 |         class = 'A';
      |         ^~~~~
a.cc:34:9: error: expected primary-expression before 'class'
   34 |         class = 'A';
      |         ^~~~~
a.cc:36:9: error: expected primary-expression before 'class'
   36 |         class = 'A';
      |         ^~~~~
a.cc:38:9: error: expected primary-expression before 'class'
   38 |         class = 'B';
      |         ^~~~~
a.cc:40:9: error: expected primary-expression before 'class'
   40 |         class = 'B';
      |         ^~~~~
a.cc:42:9: error: expected primary-expression before 'class'
   42 |         class = 'C';
      |         ^~~~~
a.cc:45:20: error: expected primary-expression before 'class'
   45 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include <stdio.h>

void judge(int pm, int pe, int pj);

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

void judge(int pm, int pe, int pj)
{
    char class;

    if (pm == 100 || pe == 100 || pj == 100){
        class = 'A';
    } else if (pm + pe >= 180){
        class = 'A';
    } else if (pm + pe + pj >= 240){
        class = 'A';
    } else if (pm + pe + pj >= 210){
        class = 'B';
    } else if (pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)){
        class = 'B';
    } else {
        class = 'C';
    }

    printf("%c\n", class);
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:27:5: error: multiple types in one declaration
   27 |     char class;
      |     ^~~~
a.cc:27:10: error: declaration does not declare anything [-fpermissive]
   27 |     char class;
      |          ^~~~~
a.cc:27:5: error: expected primary-expression before 'char'
   27 |     char class;
      |     ^~~~
a.cc:30:9: error: expected primary-expression before 'class'
   30 |         class = 'A';
      |         ^~~~~
a.cc:32:9: error: expected primary-expression before 'class'
   32 |         class = 'A';
      |         ^~~~~
a.cc:34:9: error: expected primary-expression before 'class'
   34 |         class = 'A';
      |         ^~~~~
a.cc:36:9: error: expected primary-expression before 'class'
   36 |         class = 'B';
      |         ^~~~~
a.cc:38:9: error: expected primary-expression before 'class'
   38 |         class = 'B';
      |         ^~~~~
a.cc:40:9: error: expected primary-expression before 'class'
   40 |         class = 'C';
      |         ^~~~~
a.cc:43:20: error: expected primary-expression before 'class'
   43 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include <stdio.h>

void judge(int pm, int pe, int pj)
{
    int sum = pm + pe + pj;
    char class;

    if (pm == 100 || pe == 100 || pj == 100){
        class = 'A';
    } else if (pm + pe >= 180){
        class = 'A';
    } else if (sum >= 240){
        class = 'A';
    } else if (sum >= 210){
        class = 'B';
    } else if (sum >= 150 && (pm >= 80 || pe >= 80)){
        class = 'B';
    } else {
        class = 'C';
    }

    printf("%c\n", class);
}

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:6:5: error: multiple types in one declaration
    6 |     char class;
      |     ^~~~
a.cc:6:10: error: declaration does not declare anything [-fpermissive]
    6 |     char class;
      |          ^~~~~
a.cc:6:5: error: expected primary-expression before 'char'
    6 |     char class;
      |     ^~~~
a.cc:9:9: error: expected primary-expression before 'class'
    9 |         class = 'A';
      |         ^~~~~
a.cc:11:9: error: expected primary-expression before 'class'
   11 |         class = 'A';
      |         ^~~~~
a.cc:13:9: error: expected primary-expression before 'class'
   13 |         class = 'A';
      |         ^~~~~
a.cc:15:9: error: expected primary-expression before 'class'
   15 |         class = 'B';
      |         ^~~~~
a.cc:17:9: error: expected primary-expression before 'class'
   17 |         class = 'B';
      |         ^~~~~
a.cc:19:9: error: expected primary-expression before 'class'
   19 |         class = 'C';
      |         ^~~~~
a.cc:22:20: error: expected primary-expression before 'class'
   22 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include <stdio.h>

void judge(int pm, int pe, int pj)
{
    char class;

    if (pm == 100 || pe == 100 || pj == 100){
        class = 'A';
    } else if (pm + pe >= 180){
        class = 'A';
    } else if (pm + pe + pj >= 240){
        class = 'A';
    } else if (pm + pe + pj >= 210){
        class = 'B';
    } else if (pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)){
        class = 'B';
    } else {
        class = 'C';
    }

    printf("%c\n", class);
}

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:5:5: error: multiple types in one declaration
    5 |     char class;
      |     ^~~~
a.cc:5:10: error: declaration does not declare anything [-fpermissive]
    5 |     char class;
      |          ^~~~~
a.cc:5:5: error: expected primary-expression before 'char'
    5 |     char class;
      |     ^~~~
a.cc:8:9: error: expected primary-expression before 'class'
    8 |         class = 'A';
      |         ^~~~~
a.cc:10:9: error: expected primary-expression before 'class'
   10 |         class = 'A';
      |         ^~~~~
a.cc:12:9: error: expected primary-expression before 'class'
   12 |         class = 'A';
      |         ^~~~~
a.cc:14:9: error: expected primary-expression before 'class'
   14 |         class = 'B';
      |         ^~~~~
a.cc:16:9: error: expected primary-expression before 'class'
   16 |         class = 'B';
      |         ^~~~~
a.cc:18:9: error: expected primary-expression before 'class'
   18 |         class = 'C';
      |         ^~~~~
a.cc:21:20: error: expected primary-expression before 'class'
   21 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include <stdio.h>
void judge(int pm, int pe, int pj)
{
    char class;
    if(pm == 100 || pe == 100 || pj == 100){
        class='A';
    }else if(pm + pe >= 180){
        class='A';
    }else if(pm + pe + pj >= 240){
        class='A';
    }else if(pm + pe + pj >= 210){
        class='B';
    }else if(pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)){
        class='B';
    }else{
        class='C';
    }
    printf("%c\n", class);
}

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:4:5: error: multiple types in one declaration
    4 |     char class;
      |     ^~~~
a.cc:4:10: error: declaration does not declare anything [-fpermissive]
    4 |     char class;
      |          ^~~~~
a.cc:4:5: error: expected primary-expression before 'char'
    4 |     char class;
      |     ^~~~
a.cc:6:9: error: expected primary-expression before 'class'
    6 |         class='A';
      |         ^~~~~
a.cc:8:9: error: expected primary-expression before 'class'
    8 |         class='A';
      |         ^~~~~
a.cc:10:9: error: expected primary-expression before 'class'
   10 |         class='A';
      |         ^~~~~
a.cc:12:9: error: expected primary-expression before 'class'
   12 |         class='B';
      |         ^~~~~
a.cc:14:9: error: expected primary-expression before 'class'
   14 |         class='B';
      |         ^~~~~
a.cc:16:9: error: expected primary-expression before 'class'
   16 |         class='C';
      |         ^~~~~
a.cc:18:20: error: expected primary-expression before 'class'
   18 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include <stdio.h>

void judge(int pm, int pe, int pj);

int main(void)
{
    int dataset;
    int pm, pe, pj;

    while (1){
        scanf("%d", &dataset);
        if (dataset == 0){
            break;
        } else {
            while (dataset--){
                scanf("%d %d %d", &pm, &pe, &pj);
                judge(pm, pe, pj);
            }
        }
    }

    return 0;
}

void judge(int pm, int pe, int pj)
{
    int sum = pm + pe + pj;
    char class;

    if (pm == 100 || pe == 100 || pj == 100){
        class = 'A';
    } else if (pm + pe >= 90 * 2){
        class = 'A';
    } else if (sum >= 80 * 3){
        class = 'A';
    } else if (sum >= 70 * 3){
        class = 'B';
    } else if (sum >= 50 * 3 && (pm >= 80 || pe >= 80)){
        class = 'B';
    } else {
        class = 'C';
    }

    printf("%c\n", class);
}

Compiler output:
a.cc: In function 'void judge(int, int, int)':
a.cc:28:5: error: multiple types in one declaration
   28 |     char class;
      |     ^~~~
a.cc:28:10: error: declaration does not declare anything [-fpermissive]
   28 |     char class;
      |          ^~~~~
a.cc:28:5: error: expected primary-expression before 'char'
   28 |     char class;
      |     ^~~~
a.cc:31:9: error: expected primary-expression before 'class'
   31 |         class = 'A';
      |         ^~~~~
a.cc:33:9: error: expected primary-expression before 'class'
   33 |         class = 'A';
      |         ^~~~~
a.cc:35:9: error: expected primary-expression before 'class'
   35 |         class = 'A';
      |         ^~~~~
a.cc:37:9: error: expected primary-expression before 'class'
   37 |         class = 'B';
      |         ^~~~~
a.cc:39:9: error: expected primary-expression before 'class'
   39 |         class = 'B';
      |         ^~~~~
a.cc:41:9: error: expected primary-expression before 'class'
   41 |         class = 'C';
      |         ^~~~~
a.cc:44:20: error: expected primary-expression before 'class'
   44 |     printf("%c\n", class);
      |                    ^~~~~
Language: C++

#include<stdio.h>

void dividing(int pm, int pe, int pj);

int main(void)
{
  int n, pm, pe, pj;
  int i;
  while (1) {
  scanf("%d", &n);
  if (n == 0) {
    break;
  } else {
  while (i < n) {
    scanf("%d %d %d", &pm, &pe, &pj);
    dividing(pm, pe, pj);
    i++;
  }
  }
  }
  return 0;
}

void dividing(int pm, int pe, int pj)
{
  if (pm == 100 || pe == 100 || pj == 100) {
    printf("A\n");
  }
  else if ((pm + pe) / 2 > 90){
    printf("A\n");
  }
  else if ((pm + pe + pj) / 3 >80){
    printf("A\n");
  }
  else if ((pm + pe + pj) / 3 > 70){
    printf("B\n");
  }
  else if((pm + pe + pj) / 3 > 50 && (pm > 80 || pe > 80)){
    printf("B\n");
  } else {
    printf("C\n");
  }

Compiler output:
a.cc: In function 'void dividing(int, int, int)':
a.cc:42:4: error: expected '}' at end of input
   42 |   }
      |    ^
a.cc:25:1: note: to match this '{'
   25 | {
      | ^
Language: C++

#include <stdio.h>

int classjudge(int pm,int pe,int pj){
    int class;
    if(pm == 100 || pe== 100 || pj== 100)class=0;
    else if(pm + pe >= 180)class=0;
    else if(pm + pe + pj >= 240)class=0;
    else if(pm + pe + pj >= 210)class=1;
    else if((pm + pe + pj >= 150) && (pm >= 80 || pe >= 80))class=1;
    else class=2;
    return class;
}

int main(void){
    int n,pm,pe,pj;
    while(scanf("%d",&n) != EOF && n != 0){
        for(int i=0;i < n;i++){
            scanf("%d %d %d",&pm,&pe,&pj);
            printf("%c\n",'A' + classjudge(pm,pe,pj));
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int classjudge(int, int, int)':
a.cc:4:5: error: multiple types in one declaration
    4 |     int class;
      |     ^~~
a.cc:4:9: error: declaration does not declare anything [-fpermissive]
    4 |     int class;
      |         ^~~~~
a.cc:4:5: error: expected primary-expression before 'int'
    4 |     int class;
      |     ^~~
a.cc:5:42: error: expected primary-expression before 'class'
    5 |     if(pm == 100 || pe== 100 || pj== 100)class=0;
      |                                          ^~~~~
a.cc:6:28: error: expected primary-expression before 'class'
    6 |     else if(pm + pe >= 180)class=0;
      |                            ^~~~~
a.cc:7:33: error: expected primary-expression before 'class'
    7 |     else if(pm + pe + pj >= 240)class=0;
      |                                 ^~~~~
a.cc:8:33: error: expected primary-expression before 'class'
    8 |     else if(pm + pe + pj >= 210)class=1;
      |                                 ^~~~~
a.cc:9:61: error: expected primary-expression before 'class'
    9 |     else if((pm + pe + pj >= 150) && (pm >= 80 || pe >= 80))class=1;
      |                                                             ^~~~~
a.cc:10:10: error: expected primary-expression before 'class'
   10 |     else class=2;
      |          ^~~~~
a.cc:11:12: error: expected primary-expression before 'class'
   11 |     return class;
      |            ^~~~~
a.cc:11:11: error: expected ';' before 'class'
   11 |     return class;
      |           ^~~~~~
      |           ;
a.cc:11:12: error: expected primary-expression before 'class'
   11 |     return class;
      |            ^~~~~
Language: C++

#include <stdio.h>

int classjudge(int pm,int pe,int pj){
    int class;
    if(pm == 100 || pe== 100 || pj== 100){
        class=0;
    }
    else if(pm + pe >= 180){
        class=0;
    }
    else if(pm + pe + pj >= 240){
        class=0;
    }
    else if(pm + pe + pj >= 210){
        class=1;
    }
    else if((pm + pe + pj >= 150) && (pm >= 80 || pe >= 80)){
        class=1;
    }
    else class=2;
    return class;
}

int main(void){
    int n,pm,pe,pj;
    while(scanf("%d",&n) != EOF && n != 0){
        for(int i=0;i < n;i++){
            scanf("%d %d %d",&pm,&pe,&pj);
            printf("%c\n",'A' + classjudge(pm,pe,pj));
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int classjudge(int, int, int)':
a.cc:4:5: error: multiple types in one declaration
    4 |     int class;
      |     ^~~
a.cc:4:9: error: declaration does not declare anything [-fpermissive]
    4 |     int class;
      |         ^~~~~
a.cc:4:5: error: expected primary-expression before 'int'
    4 |     int class;
      |     ^~~
a.cc:6:9: error: expected primary-expression before 'class'
    6 |         class=0;
      |         ^~~~~
a.cc:9:9: error: expected primary-expression before 'class'
    9 |         class=0;
      |         ^~~~~
a.cc:12:9: error: expected primary-expression before 'class'
   12 |         class=0;
      |         ^~~~~
a.cc:15:9: error: expected primary-expression before 'class'
   15 |         class=1;
      |         ^~~~~
a.cc:18:9: error: expected primary-expression before 'class'
   18 |         class=1;
      |         ^~~~~
a.cc:20:10: error: expected primary-expression before 'class'
   20 |     else class=2;
      |          ^~~~~
a.cc:21:12: error: expected primary-expression before 'class'
   21 |     return class;
      |            ^~~~~
a.cc:21:11: error: expected ';' before 'class'
   21 |     return class;
      |           ^~~~~~
      |           ;
a.cc:21:12: error: expected primary-expression before 'class'
   21 |     return class;
      |            ^~~~~