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

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int i,j;
    int x,y;

    int n,m;
    int **a=NULL;
    int *b=NULL;

    scanf("%d %d",&n,&m);

    /* 配列の領域を動的確保 */
    a =(int **)malloc(n*sizeof(int));
    if(a == NULL){
        return 0;
    }

    b =(int *)malloc(m*sizeof(int));
    if(b == NULL){
        return 0;
    }

    for(i=0;i<n;i++){
        a[i] = malloc(m*sizeof(int));
    }

    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            if(j==0){
                scanf("%d",&x);
            }
            else{
                scanf(" %d",&x);
            }
            a[i][j] = x;
        }
    }

    for(i=0;i<m;i++){
        scanf("%d",&x);
        b[i] =x;
    }


    for(i=0;i<n;i++){
        y=0;
        for(j=0;j<m;j++){
            y += a[i][j]*b[j];
        }

        printf("%d\n",y);
    }


    /* a,bの領域解放 */
    for(i;i<n;i++){
        free(a[i]);
    }

    free(a);
    free(b);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   27 |         a[i] = malloc(m*sizeof(int));
      |                ~~~~~~^~~~~~~~~~~~~~~
      |                      |
      |                      void*
Language: C++

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    int i,j;
    int x=0;
    int y=0;
    int z1,z2=0;

    int n,m;
    int **a;
    int *b;

    scanf("%d %d",&n,&m);

    a =(int **)malloc(n*sizeof(int));
    b =(int *)malloc(m*sizeof(int));

    for(i=0;i<n;i++){
        a[i] = (int *)malloc(m*sizeof(int));
    }

    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            if(j==0){
                scanf("%d",&x);
            }
            else{
                scanf(" %d",&x);
            }
            a[i][j] = x;
        }
    }

    for(i=0;i<m;i++){
        scanf("%d",&x);
        b[i] =x;
    }


    for(i=0;i<n;i++){
        y=0;
        for(j=0;j<m;j++){
            z1 = a[i][j]
            z2 = b[j];
            y += z1*z2;
        }

        printf("%d\n",y);
    }

    for(i=0;i<n;i++){
        free(a[i]);
    }

    free(a);
    free(b);

    return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:45:25: error: expected ';' before 'z2'
   45 |             z1 = a[i][j]
      |                         ^
      |                         ;
   46 |             z2 = b[j];
      |             ~~
Language: C++

#include<iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){

  int n,m;
  cin >> n >> m;

  int a[n*m] ;
  int b[m] ;

  memset(a,0,n*m*sizeof(int));
  memset(b,0,m*sizeof(int));

  for(int i=0;i<n*m;i++){
    cin >> a[i];
  }
  for(int i=0;i<m;i++){
    cin >> b[i];
  }

  for(int j=0;j<n;j++){

    int sum=0;
    for(int i=0;i<m;i++){
      sum += a[i+j*m] * b[i];
      cout << "i:"<<i<<",j:"<<j <<" a:"<<a[i+j*m]<<" b:"<<b[j]<<endl;
    }
    cout << sum << endl;
  }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'memset' was not declared in this scope
   13 |   memset(a,0,n*m*sizeof(int));
      |   ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <math.h>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){

  int n,m;
  cin >> n >> m;

  int a[n*m] ;
  int b[m] ;

  memset(a,0,n*m*sizeof(int));
  memset(b,0,m*sizeof(int));

  for(int i=0;i<n*m;i++){
    cin >> a[i];
  }
  for(int i=0;i<m;i++){
    cin >> b[i];
  }

  for(int j=0;j<n;j++){

    int sum=0;
    for(int i=0;i<m;i++){
      sum += a[i+j*m] * b[i];
    }
    cout << sum << endl;
  }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'memset' was not declared in this scope
   13 |   memset(a,0,n*m*sizeof(int));
      |   ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <math.h>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<iostream>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
int main(){

  int n,m;
  cin >> n >> m;

  int a[n*m] ;
  int b[m] ;

  memset(a,0,n*m*sizeof(int));
  memset(b,0,m*sizeof(int));

  for(int i=0;i<n*m;i++){
    cin >> a[i];
  }
  for(int i=0;i<m;i++){
    cin >> b[i];
  }

  for(int j=0;j<n;j++){

    int sum=0;
    for(int i=0;i<m;i++){
      sum += a[i+j*m] * b[i];
    }
    cout << sum << endl;
  }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'memset' was not declared in this scope
   16 |   memset(a,0,n*m*sizeof(int));
      |   ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <stdlib.h>
  +++ |+#include <cstring>
    6 |
Language: C++

#include <cstdio>

int main(){
    int n, m, a[100][100], b[100], c[100];
    scanf("%d %d", &n, &m);
    
    for (int i=1; i<=n; i++){
        for (int j=1; j<=m; j++){
            scanf("%d",&a[i][j]);
        }
    }
    for (int i=1; i<=n; i++){
        scanf("%d", &b[k]);
    }
    
    for (int i=1; i<=n; i++){
c[i]=0;
        for (int j=1; j<=m; j++){
            c[i] += (a[i][j] * b[j]);
        }
    }

    for (int j=1; j<=n; j++){
      printf("%d\n", c[j]);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'k' was not declared in this scope
   13 |         scanf("%d", &b[k]);
      |                        ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    int a[101][101];
    int b[101],c[101];
    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            cin>>a[i][j];
        }
    }
    for(i=0;i<m;i++){
        cin>>b[i];
    }
    for(i=0;i<n;i++){
        c[i]=0;
        for(int j=0;j<m;j++){
            c[i]+=a[i][j]*b[j];
        }
        cin<<c[i]<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i=0;i<n;i++){
      |         ^
a.cc:11:13: error: 'j' was not declared in this scope
   11 |         for(j=0;j<m;j++){
      |             ^
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     for(i=0;i<m;i++){
      |         ^
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     for(i=0;i<n;i++){
      |         ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
	int n;
	int m;				// 行と列
	
	// 行列のサイズを入力
	cin >> n;
	cin >> m;
	
	// 動的変数の確保
	int *arrayA = new int [n][m];
	int *arrayB = new int [m];
	int answer  = 0;
	
	// 行列の要素を入力
	for(int i = 0; i < n; i++)
	{
		for(int j = 0; j < m; j++)
		{
			cin >> arrayA[i][j];
		}
	}
	
	for(int i = 0; i < m; i++)
	{
		cin >> arrayB[i];
	}
	
	// 各行の積を計算して出力
	for(int i = 0; i < n; i++)
	{
		answer = 0;
		for(int j = 0; j < m; j++)
		{
			answer += arrayA[i][j] * arrayB[j];
		}
		cout << answer << endl;
	}
	
	// 動的変数の削除
	delete [] arrayA;
	delete [] arrayB;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: array size in new-expression must be constant
   15 |         int *arrayA = new int [n][m];
      |                                    ^
a.cc:15:36: error: the value of 'm' is not usable in a constant expression
a.cc:8:13: note: 'int m' is not const
    8 |         int m;                          // 行と列
      |             ^
a.cc:24:41: error: invalid types 'int[int]' for array subscript
   24 |                         cin >> arrayA[i][j];
      |                                         ^
a.cc:39:44: error: invalid types 'int[int]' for array subscript
   39 |                         answer += arrayA[i][j] * arrayB[j];
      |                                            ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<utility>
#include<map>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,m,n) for(ll i=m;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)
#define FORR(i,n,m) for(ll i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 100000000
#define MOD 100000007
#define SIZE 100005
#define pi 	3.14159265358979323846

int main(){
	ll n,m;
	cin >> n >> m;
	ll c1[100][100];
	REP(i,n){
		REP(j,m){
			cin >> c1[i][j];
		}
	}
	ll c2[100];
	REP(i,m){
		cin >>c2[i];
	}
	ll ans[100];
	REP(i,n){
		REP(j,m){
			ans[i] += c1[i][j] * c2[j];
		}
	}
	REP(i,n){
		cout << ans[i]; <<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:33: error: expected primary-expression before '<<' token
   48 |                 cout << ans[i]; <<endl;
      |                                 ^~
Language: C++

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

int main(){
    int n,m;
    cin  >>n>>m;
    int a[100][100];
    for(int i =0;i<n;i++)
       for(int j =0;;j<m;j++) cin >>a[i][j];
        

    int b[100];
    for(int i = 0;i<m;i++) cin >>b[i];
    int c[100] = {};
    for (int i=0;i<n;i++)
         for(int j =0;j<m;j++)c[i] +=a[i][j]*b[j];
         
    for(int i = 0;i<n;i++) cout <<c[i]<<endl;

     return 0;
   }


Compiler output:
a.cc:4:1: error: expected identifier before 'int'
    4 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | 
    4 | int main(){
      | ~~~             
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin  >>n>>m;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:25: error: expected ')' before ';' token
    9 |        for(int j =0;;j<m;j++) cin >>a[i][j];
      |           ~             ^
      |                         )
a.cc:9:26: error: 'j' was not declared in this scope
    9 |        for(int j =0;;j<m;j++) cin >>a[i][j];
      |                          ^
a.cc:18:28: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     for(int i = 0;i<n;i++) cout <<c[i]<<endl;
      |                            ^~~~
      |                            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:41: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |     for(int i = 0;i<n;i++) cout <<c[i]<<endl;
      |                                         ^~~~
      |                                         std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main(){
    int n,m;
    cin  >>n>>m;
    int a[100][100];
    for(int i =0;i<n;i++)
       for(int j =0;;j<m;j++) cin >>a[i][j];
        

    int b[100];
    for(int i = 0;i<m;i++) cin >>b[i];
    int c[100] = {};
    for (int i=0;i<n;i++)
         for(int j =0;j<m;j++)c[i] +=a[i][j]*b[j];
         
    for(int i = 0;i<n;i++) cout <<c[i]<<endl;

     return 0;
   }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected ')' before ';' token
    9 |        for(int j =0;;j<m;j++) cin >>a[i][j];
      |           ~             ^
      |                         )
a.cc:9:26: error: 'j' was not declared in this scope
    9 |        for(int j =0;;j<m;j++) cin >>a[i][j];
      |                          ^
Language: C++

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


int main(){
  int n,m;
  cin>>n>>m;
  int a[100][100];
  for(int i=0;i<n;i++)
    for(int j=0;j<m;j++) cin>>a[i][j];

  int b[100];
  for(int i=0;i<m;j++) cin>>a[i][j];
  int c[100] = {};
  for(int i=0;i<n;i++)
   for(int j=0;j<m;j++) c[i] += a[i][j] * b[j];
 
 for(int i=0;i<n;i++) cout<<c[i]<<endl;

 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'j' was not declared in this scope
   13 |   for(int i=0;i<m;j++) cin>>a[i][j];
      |                   ^
Language: C++

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

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

	int gyoretu[100][100];
	int vector[100];

	//行列読み込み
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			int input;
			cin >> input;
			gyoretu[i][j] = input;
		}
	}

	//ベクトル読み込み
	for (int i = 0; i < m; i++)
	{
		int input;
		cin >> input;
		vector[i] = input;
	}
	
	//演算
	for (int i = 0; i < n; i++)
	{
		int ax = 0;

		for (int j = 0; j < m; j++)
		{
			ax += (gyoretu[i][j] * vector[j]);
		}
		cout << ax << 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<C:\bits\stdc++.h>
using namespace std;

int main(){
    int n,m;

    cin>>n>>m;

    int a[n][m];

    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cin>>a[i][j];
        }
    }
    int b[m];

    for(int i=0;i<m;i++){
        cin>>b[i];
    }
    
    int c[n];

    for(int i=0;i<n;i++){
        c[i]=0; 
    }

    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            c[i]+=a[i][j]*b[j];  
        }
    }
    
    for(int i=0;i<n;i++){
        cout<<c[i]<<endl;
    }

}


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

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

int n,m;
cin>>n>>m;

int a[n][m];

for(int i=0;i<n;i++){
 for(int j=0;j<m;j++){
  cin>>a[i][j];
 }
}

int b[m];
int c[n];

for(int i=0;i<m;i++){
 cin>>b[i];
}

for(int i=0;i<n;i++){
 for(int j=0;j<m;i++){
  c[i]= a[i][j] * b[j]
 }
}

for(int i=0;i<n;i++){
cout<<c[i]<<endl;
}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: expected ';' before '}' token
   25 |   c[i]= a[i][j] * b[j]
      |                       ^
      |                       ;
   26 |  }
      |  ~
Language: C++

	int x = 0;
	
	cin >> a >> b;
	vector<vector<int>> vec1;
	vector<int> vec2(b);
	
	vec1 = vector<vector<int>>(a, vector<int>(b,0));
	
	
	for (int i = 0; i < a; i++){

		for(int j = 0; j < b; j++){

			cin >> vec1.at(i).at(j) ;
		}
	}
	for (int j = 0; j<b; j++){
		cin >> vec2.at(j);
	}
		
	for(int i = 0; i<a; i++){
		x = 0;
		for(int j = 0; j<b; j++){
			x =  x + vec1.at(i).at(j) * vec2.at(j);
		   
		}
		cout << x << endl;
		x = 0;
	}
}


Compiler output:
a.cc:3:9: error: 'cin' does not name a type
    3 |         cin >> a >> b;
      |         ^~~
a.cc:4:9: error: 'vector' does not name a type
    4 |         vector<vector<int>> vec1;
      |         ^~~~~~
a.cc:5:9: error: 'vector' does not name a type
    5 |         vector<int> vec2(b);
      |         ^~~~~~
a.cc:7:9: error: 'vec1' does not name a type
    7 |         vec1 = vector<vector<int>>(a, vector<int>(b,0));
      |         ^~~~
a.cc:10:9: error: expected unqualified-id before 'for'
   10 |         for (int i = 0; i < a; i++){
      |         ^~~
a.cc:10:25: error: 'i' does not name a type
   10 |         for (int i = 0; i < a; i++){
      |                         ^
a.cc:10:32: error: 'i' does not name a type
   10 |         for (int i = 0; i < a; i++){
      |                                ^
a.cc:17:9: error: expected unqualified-id before 'for'
   17 |         for (int j = 0; j<b; j++){
      |         ^~~
a.cc:17:25: error: 'j' does not name a type
   17 |         for (int j = 0; j<b; j++){
      |                         ^
a.cc:17:30: error: 'j' does not name a type
   17 |         for (int j = 0; j<b; j++){
      |                              ^
a.cc:21:9: error: expected unqualified-id before 'for'
   21 |         for(int i = 0; i<a; i++){
      |         ^~~
a.cc:21:24: error: 'i' does not name a type
   21 |         for(int i = 0; i<a; i++){
      |                        ^
a.cc:21:29: error: 'i' does not name a type
   21 |         for(int i = 0; i<a; i++){
      |                             ^
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
#include<stdio.h>
using namespace std;

int main(){
    int n,m;
    cin >> n >> m;
    int a[n][m];
    for(int i = 0; i < n; i++){
        for (int j = 0; j < m ;j++){
            int x;
            cin >> x;
            a[i][j] = x;

        }
    }
    int b[m];
    for (int j = 0; j < m ;j++){
        int x;
        cin >> x;
        b[j] = x;

    }

    for(int i = 0; i < n; i++){
        int sums = 0; 
        for (int j = 0; j < m ;j++){
            sums += a[i][j] * b[j]
        }
        cout << sums << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:35: error: expected ';' before '}' token
   45 |             sums += a[i][j] * b[j]
      |                                   ^
      |                                   ;
   46 |         }
      |         ~
Language: C++

#include <stdio.h>
int main(void){
    
    int n,m;
    scanf("%d",&n);
    scanf("%d",&m);
    int a[100][100];
    int b[100];
    int c[100];
    
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            scanf("%d",&A[i][j]);
        }
    }
    for(int i=0;i<m;i++){
        scanf("%d",&B[i]);
    }
    for(int i=0;i<n;i++){
        C[i]=0;
        for(int j=0;j<m;j++){
            C[i]+=A[i][j]*B[j];
        }
        printf("%d\n",C[i]);
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'A' was not declared in this scope
   13 |             scanf("%d",&A[i][j]);
      |                         ^
a.cc:17:21: error: 'B' was not declared in this scope
   17 |         scanf("%d",&B[i]);
      |                     ^
a.cc:20:9: error: 'C' was not declared in this scope
   20 |         C[i]=0;
      |         ^
a.cc:22:19: error: 'A' was not declared in this scope
   22 |             C[i]+=A[i][j]*B[j];
      |                   ^
a.cc:22:27: error: 'B' was not declared in this scope
   22 |             C[i]+=A[i][j]*B[j];
      |                           ^
Language: Java

import java.util.Scanner;

public class Main_3 {
	
	public static void main(String [] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m + f >= 80){
				System.out.println("A");
			}else if(m + f >= 65){
				System.out.println("B");
			}else if(m + f >= 50){
				System.out.println("C");
			}else if(m + f >= 30){
				if(r >= 50){
					System.out.println("C");
				}
				System.out.println("D");
			}else if(m + f < 30){
				System.out.println("F");
			}
		}
	}
}


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

import java.util.Scanner;

public class Main_3 {
	
	public static void main(String [] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m + f >= 80){
				System.out.println("A");
			}else if(m + f >= 65){
				System.out.println("B");
			}else if(m + f >= 50){
				System.out.println("C");
			}else if(m + f < 30){
				System.out.println("F");
			}else if(m == -1 || f == -1){
				System.out.println("F");
			
			if(m + r >= 30){
				if(r >= 50){
					System.out.println("C");
				}
			}else{
				System.out.println("D");
			}
			}
		}
	}
}


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


import java.util.Scanner;

class Main {

    static int gcd(int x, int y) {
        if (y == 0) {
            return x;
        } else {
            return gcd(y, x % y);
        }
    }

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

        int m = sc.nextInt();
        int f = sc.nextInt();
        int r = sc.nextInt();
        while (m != -1 || f != -1 || r != -1) {
            m = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();
        }
        if(m == 0 || f == 0 || m + f < 30){
            System.out.println("F");   
        }
        if(80 <= m + f) {
            System.out.println("A");
        }
        else if(65 <= m + f < 80) {
            System.out.println("B");
        }
        if(50 <= m + f < 65) {
            System.out.println("C");
        }
        if(30 <= m + f < 50 && r <= 50) {
            System.out.println("C");
        }
        if(30 <= m + f < 50 && r > 50){
            System.out.println("D");
        }
       
        }

    
}



Compiler output:
Main.java:31: error: bad operand types for binary operator '<'
        else if(65 <= m + f < 80) {
                            ^
  first type:  boolean
  second type: int
Main.java:34: error: bad operand types for binary operator '<'
        if(50 <= m + f < 65) {
                       ^
  first type:  boolean
  second type: int
Main.java:37: error: bad operand types for binary operator '<'
        if(30 <= m + f < 50 && r <= 50) {
                       ^
  first type:  boolean
  second type: int
Main.java:40: error: bad operand types for binary operator '<'
        if(30 <= m + f < 50 && r > 50){
                       ^
  first type:  boolean
  second type: int
4 errors
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m, f, r;
        while ((m = scanner.nextInt()) >= 0 || (f = scanner.nextInt()) >= 0) {
            r = scanner.nextInt();
            char grade = ' ';
            int mf = m + f;
            if (m < 0 || f < 0) grade = 'F';
            else if (mf >= 80) grade = 'A';
            else if (65 <= mf && mf < 80) grade = 'B';
            else if (50 <= mf && mf < 65) grade = 'C';
            else if (30 <= mf && mf < 50) {
                grade = 'D';
                if (r >= 50) grade = 'C';
            } else if (mf < 30) grade = 'F';
            System.out.println(grade);
        }
    }
}


Compiler output:
Main.java:10: error: variable f might not have been initialized
            int mf = m + f;
                         ^
1 error
Language: Java

import java.util.*;

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

    Scanner sc = new Scanner(System.in);

    while(true){
      int m = sc.nextInt();
      int f = sc.nextInt();
      int r = sc.nextInt();

      int sum = m + f;

      if(sum >= 80){
        System.out.println("A");
      }else if(sum >= 65 && sum < 80){
        System.out.println("B");
      }else if(sum >= 50 && sum < 65){
        System.out.println("C");
      }else if(sum >= 30 && sum < 50 && r < 50){
        System.out.println("D");
      }else if(sum >= 30 && sum < 50 && r >= 50){
        System.out.println("C");
      }else if(sum < 30 && m >=0 && f >= 0){
        System.out.println("F");
      }else if(m == -1 && f == -1 && r == -1){
        return;
      }else{
        System.out.println("F");
      }
    }
  }
}



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

import java.util.Scanner;
public class Main{
public static void main(String[] args) {
  Scanner scan =new Scanner(System.in);
  int m,f,r;
  m=scan.nextInt();
  f=scan.nextInt();
  r=scan.nextInt();
  if((m==-1)&&(f==-1)&&(r==-1)){
    // System.out.println("");
    break;
}
else
   if(m==-1||f==-1){
  System.out.println("F");
}else if(m+f>=80){
  System.out.println("A");
} else if(m+f>=65){
    System.out.println("B");
} else if(m+f>=50){
      System.out.println("C");
} else if(m+f>=30&&r>50){
  System.out.println("D");
}else if(m+f<30){
    System.out.println("F");
  }



}
}



Compiler output:
Main.java:11: error: break outside switch or loop
    break;
    ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
public static void main(String[] args) {
  Scanner scan =new Scanner(System.in);
  int m,f,r;
  m=scan.nextInt();
  f=scan.nextInt();
  r=scan.nextInt();
  if((m==-1)&&(f==-1)&&(r==-1)){
    break;
}
else
   if(m==-1||f==-1){
  System.out.println("F");
}else if(m+f>=80){
  System.out.println("A");
} else if(m+f>=65){
    System.out.println("B");
} else if(m+f>=50){
      System.out.println("C");
} else if(m+f>=30&&r>50){
  System.out.println("D");
}else if(m+f<30){
    System.out.println("F");
  }



}
}



Compiler output:
Main.java:10: error: break outside switch or loop
    break;
    ^
1 error
Language: Java

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int m,f,r;
        String rate;
        while(true){
            m=sc.nextInt();
            f=sc.nextInt();
            r=sc.nextInt();
            if(m==-1 && f==-1 && r==-1){
                break;
            }else if(m=-1 || f==-1){
                rete="F";
            }else if(m+f>=80){
                rate="A";
            }else if(m+f>=65 && m+f<80){
                rate="B";
            }else if(m+f>=50 && m+f<65){
                rate="C";
            }else if(m+f>=30 && m+f<50){
                if(r>50){
                    rate="C";
                }else{
                    rate="D";
                }
            }else if(m+f<30){
                rate="F";
            }
            System.out.println(rate);
        }
    }
}


Compiler output:
Main.java:13: error: bad operand types for binary operator '||'
            }else if(m=-1 || f==-1){
                          ^
  first type:  int
  second type: boolean
Main.java:13: error: incompatible types: int cannot be converted to boolean
            }else if(m=-1 || f==-1){
                      ^
Main.java:14: error: cannot find symbol
                rete="F";
                ^
  symbol:   variable rete
  location: class Main
3 errors
Language: Java

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int m,f,r;
        String rate;
        while(true){
            m=sc.nextInt();
            f=sc.nextInt();
            r=sc.nextInt();
            if(m==-1 && f==-1 && r==-1){
                break;
            }else if(m==-1 || f==-1){
                rete="F";
            }else if(m+f>=80){
                rate="A";
            }else if(m+f>=65 && m+f<80){
                rate="B";
            }else if(m+f>=50 && m+f<65){
                rate="C";
            }else if(m+f>=30 && m+f<50){
                if(r>50){
                    rate="C";
                }else{
                    rate="D";
                }
            }else if(m+f<30){
                rate="F";
            }
            System.out.println(rate);
        }
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
                rete="F";
                ^
  symbol:   variable rete
  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 m,f,r;
        String rate;
        while(true){
            m=sc.nextInt();
            f=sc.nextInt();
            r=sc.nextInt();
            if(m==-1 && f==-1 && r==-1){
                break;
            }else if(m==-1 || f==-1){
                rate="F";
            }else if(m+f>=80){
                rate="A";
            }else if(m+f>=65 && m+f<80){
                rate="B";
            }else if(m+f>=50 && m+f<65){
                rate="C";
            }else if(m+f>=30 && m+f<50){
                if(r>50){
                    rate="C";
                }else{
                    rate="D";
                }
            }else if(m+f<30){
                rate="F";
            }
            System.out.println(rate);
        }
    }
}


Compiler output:
Main.java:30: error: variable rate might not have been initialized
            System.out.println(rate);
                               ^
1 error
Language: Java

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

/**
 * Lesson7A あなたの課題は、あるクラスの数学の成績を付けるプログラムを作成することです。
 *
 * プログラムは複数の学生のテストの点数を読み込みます。
 *
 * テストの点数は、中間試験の点数 m、期末試験の点数 f、再試験の点数 r で構成されています。
 *
 * 中間試験と期末試験は 50 点満点（m, f ? 50）、再試験は 100 点満点 （r ? 100）です。
 *
 * 試験を受けていない場合は点数を -1 とします。
 *
 * 以下の手順で成績が付けられます： ?中間試験、期末試験のいずれかを欠席した場合成績は F。 ?中間試験と期末試験の合計点数が 80 以上ならば成績は A
 * 。 ?中間試験と期末試験の合計点数が 65 以上 80 未満ならば成績は B。 ?中間試験と期末試験の合計点数が 50 以上 65 未満ならば成績は C。
 * ?中間試験と期末試験の合計点数が 30 以上 50 未満ならば成績は D。 ただし、再試験の点数が 50 以上ならば成績は C。
 * ?中間試験と期末試験の合計点数が 30 未満ならば成績は F。
 *
 * @author Internship
 *
 */
public class Lesson7A {

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

		// 答え　A?F以外で初期化
		ArrayList<Character> chaAnswer = new ArrayList<Character>();

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


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

				//終了条件
				if(strLine1.equals("-1 -1 -1")) {
					break;
				}

				// ばらけさせる
				String[] strAryLine1 = strLine1.split(" ");

				// int型にキャスト
				// 中間テスト
				int IntermediateTest = Integer.parseInt(strAryLine1[0]);

				// 期末テスト
				int intYearEndTest = Integer.parseInt(strAryLine1[1]);

				// 追試
				int intAdditionalTest = Integer.parseInt(strAryLine1[2]);

				// 答えのストック　A?F以外で初期化
				char chaAnswerStock = 'G';

				// 成績の判断
				if (80 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'A';
				} else if (65 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'B';
				} else if (50 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'C';
				} else if (30 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'D';

					if (50 <= intAdditionalTest) {
						chaAnswerStock = 'C';
					}
				} else {
					chaAnswerStock = 'F';
				}
				chaAnswer.add(chaAnswerStock);
			}

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

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

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

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

/**
 * Lesson7A あなたの課題は、あるクラスの数学の成績を付けるプログラムを作成することです。
 *
 * プログラムは複数の学生のテストの点数を読み込みます。
 *
 * テストの点数は、中間試験の点数 m、期末試験の点数 f、再試験の点数 r で構成されています。
 *
 * 中間試験と期末試験は 50 点満点（m, f ? 50）、再試験は 100 点満点 （r ? 100）です。
 *
 * 試験を受けていない場合は点数を -1 とします。
 *
 * 以下の手順で成績が付けられます： ?中間試験、期末試験のいずれかを欠席した場合成績は F。 ?中間試験と期末試験の合計点数が 80 以上ならば成績は A
 * 。 ?中間試験と期末試験の合計点数が 65 以上 80 未満ならば成績は B。 ?中間試験と期末試験の合計点数が 50 以上 65 未満ならば成績は C。
 * ?中間試験と期末試験の合計点数が 30 以上 50 未満ならば成績は D。 ただし、再試験の点数が 50 以上ならば成績は C。
 * ?中間試験と期末試験の合計点数が 30 未満ならば成績は F。
 *
 * @author Internship
 *
 */
public class Lesson7A {

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

		// 答え　A?F以外で初期化
		ArrayList<Character> chaAnswer = new ArrayList<Character>();

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


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

				//終了条件
				if(strLine1.equals("-1 -1 -1")) {
					break;
				}

				// ばらけさせる
				String[] strAryLine1 = strLine1.split(" ");

				// int型にキャスト
				// 中間テスト
				int IntermediateTest = Integer.parseInt(strAryLine1[0]);

				// 期末テスト
				int intYearEndTest = Integer.parseInt(strAryLine1[1]);

				// 追試
				int intAdditionalTest = Integer.parseInt(strAryLine1[2]);

				// 答えのストック　A?F以外で初期化
				char chaAnswerStock = 'G';

				// 成績の判断
				if (80 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'A';
				} else if (65 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'B';
				} else if (50 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'C';
				} else if (30 <= IntermediateTest + intYearEndTest) {
					chaAnswerStock = 'D';

					if (50 <= intAdditionalTest) {
						chaAnswerStock = 'C';
					}
				} else {
					chaAnswerStock = 'F';
				}
				chaAnswer.add(chaAnswerStock);
			}

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

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

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

int main(void) {
    int m,f,r;
    scanf("%d %d %d",&m,&f,&r);
    while(m!=-1 || f!=-1 || r!=-1) {
        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) {
            if(r>=50)printf("C\n");
            else printf("D\n");
        }
        else printf("F\n");
        scanf("%d %d %d",&m,&f,&r);
    }
    return 0;
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
int main(void) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
int main(void) {
             ^
Main.java:3: error: illegal start of expression
    scanf("%d %d %d",&m,&f,&r);
                     ^
Main.java:3: error: illegal start of expression
    scanf("%d %d %d",&m,&f,&r);
                        ^
Main.java:3: error: illegal start of expression
    scanf("%d %d %d",&m,&f,&r);
                           ^
Main.java:14: error: illegal start of expression
        scanf("%d %d %d",&m,&f,&r);
                         ^
Main.java:14: error: illegal start of expression
        scanf("%d %d %d",&m,&f,&r);
                            ^
Main.java:14: error: illegal start of expression
        scanf("%d %d %d",&m,&f,&r);
                               ^
8 errors
Language: Java

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

public class Main {

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

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (50<sum && r<=50))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}

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

import java.util.*;
import java.text.*;

class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        for(;;) {
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break;
            String sc = "";
            if(m == -1 || f == -1) sc = "F";
            else if(m + f >= 80)   sc = "A";
            else if(m + f >= 65)   sc = "B";
            else if(m + f >= 50)   sc = "C";
            else if(m + f >= 30) {
                if(r >= 50) sc = "C";
                else        sc = "D";
            } else {
                sc = "F";
            }
            System.out.println(sc);
        }
    }
}

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

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

public class Main{
	public static void main(String[] args) throws IOException{ 
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			String line = br.readLine();
			String[] spl = line.split(" ");
			int m = Integer.parseInt(spl[0]);
			int f = Integer.parseInt(spl[1]);
			int r = Integer.parseInt(spl[2]);
			if ( m == -1  && f == -1 && r == -1) {break;}
			if ( m == -1) { m += 1;}
			if ( f == -1) { f += 1;}
			if ( n == -1) { n += 1;}
			if( m + f >= 80){
				System.out.println("A");
			}else if( m + f >= 65){
				System.out.println("B");
			}else if( m + f >= 50 || ( m + f >=30) && r >= 50){
				System.out.println("C");
			}else if( m + f >= 30){
				System.out.println("D");
			}else{
				System.out.println("F");
			}
		}
	}
}

Compiler output:
Main.java:16: error: cannot find symbol
			if ( n == -1) { n += 1;}
			     ^
  symbol:   variable n
  location: class Main
Main.java:16: error: cannot find symbol
			if ( n == -1) { n += 1;}
			                ^
  symbol:   variable n
  location: class Main
2 errors
Language: Java

import java.io.*;
class Main{
public static void main throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[][] sum=new int[][];
int a=0;
while(true){
a++;
String x=br.readLine();
String y=br.readLine();
String z=br.readLine();
sum[a][0]=Intger.parseInt(x);
sum[a][1]=Intger.parseInt(y);
sum[a][2]=Intger.parseInt(z);
if(sum[a][0]==-1&&sum[a][1]==-1&&sum[a][2]==-1)
break;


}
for(int b=0;b<a;b++){
S=sum[b][0]+sum[b][1];
if(sum[b][0]==-1||sum[b][1]==-1){
if(S>=80)
System.out.println("A");
else if(S>=65)
System.out.println("B");
else if(S>=50)
System.out.println("C");
else if(S>=30&&sum[b][2]>=50)
System.out.println("C");
else if(S>=30)
System.out.println("D");
else
System.out.println("F");
}
else
System.out.println("F");

}
}
}

Compiler output:
Main.java:3: error: '(' expected
public static void main throws IOException{
                        ^
Main.java:3: error: <identifier> expected
public static void main throws IOException{
                                          ^
Main.java:5: error: array dimension missing
int[][] sum=new int[][];
                       ^
3 errors
Language: Java

import java.io.*;

class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int m = 0;
        int f = 0;
        int r = 0;        
        
        while(true) {
            String str[] = br.readLine().split(" ");
            m = Integer.parseInt(str[0]);
            f = Integer.parseInt(str[1]);
            r = Integer.parseInt(str[2]);

            if (m == -1 && f == -1 && r == -1) {
                break;
            }
            if (m == -1 || f == -1)
                System.out.println("F");
            else if (m + f >= 80)
                System.out.println("A");
            else if (m + f >= 65)
                System.out.println("B");
            else if (m + f >= 50)
                System.out.println("C");
            else if (m + f >= 30) {
                if (r >= 50)
                    System.out.println("C");
                else
                    System.out.println("D");
            } else
                System.out.println("F");
        }
    }
}

Compiler output:
Main.java:11: error: unreported exception IOException; must be caught or declared to be thrown
            String str[] = br.readLine().split(" ");
                                      ^
1 error
Language: Java

#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;
		else if (m == -1 && f == -1)
			cout << 'F' << endl;
		else if (m + f >= 80)
			cout << 'A' << endl;
		else if (m + f >= 65 && m + f < 80)
			cout << 'B' << endl;
		else if (m + f < 65 && m + f >= 50)
			cout << 'C' << endl;
		else if (m + f >= 30 && m + f < 50)
			if (r >= 50)
				cout << 'C' << endl;
			else cout << 'D' << endl;
		}
		else cout << 'F' << endl;
	}

	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:8: error: not a statement
		cin >> m >> f >> r;
		              ^
Main.java:13: error: not a statement
			cout << 'F' << endl;
			            ^
Main.java:15: error: not a statement
			cout << 'A' << endl;
			            ^
Main.java:17: error: not a statement
			cout << 'B' << endl;
			            ^
Main.java:19: error: not a statement
			cout << 'C' << endl;
			            ^
Main.java:22: error: not a statement
				cout << 'C' << endl;
				            ^
Main.java:23: error: not a statement
			else cout << 'D' << endl;
			                 ^
9 errors
printing javac parameters to: /w/javac.20260128_043825.args
Language: Java

class Main{
    public static void main(String[] args){
    	int m,f,r;
    	
    	Scanner sc = new Scanner(System.in);
    	
    	While(true){
    		m = sc.nextInt();
    		f = sc.nextInt();
    		r = sc.nextInt();
    		
    		if(m == -1 && f == -1 && r == -1){
    			break;
    		}
    		
    		if(m == -1 || f == -1 || m+f < 30){
    			System.out.println("F");
    		}
    		else if(m+f >= 80){
    			System.out.println("A");
    		}
    		else if(m+f >= 65){
    			System.out.println("B");
    		}
    		else if(m+f >=50 || r >= 50){
    			System.out.println("C");
    		}
    		else{
    			System.out.println("D");
    		}
    	}
    
    }
}

Compiler output:
Main.java:7: error: ';' expected
    	While(true){
    	           ^
1 error
Language: Java

import java.util.*;

public class Main {
    public static  void main(String  args[]) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            if (a < 0 || b < 0) {
                System.out.println("F");
            } else {
                int s = a + b;
                if (s >= 80) {
                    System.out.println("A");
                } else if (s >= 65) {
                    System.out.println("B");
                } else if (s >= 50) {
                    System.out.println("C");
                } else if (s >= 30) {
                    if (c >= 50) {
                        System.out.println("C");
                    } else {
                        System.out.println("D");
                } else {
                    System.out.println("F");
                }
            }
        }

    }
}

Compiler output:
Main.java:25: error: 'else' without 'if'
                } else {
                  ^
Main.java:32: error: reached end of file while parsing
}
 ^
2 errors
Language: Java

public class Maint {
	public static void main(String args[]){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if(m == (-1) && f == (-1) && r == (-1)){
				break;
			}else if(m+f >= 80){
				System.out.println("A");
			}else if(65 <= m+f && m+f < 80){
				System.out.println("B");
			}else if(50 <= m+f && m+f <65){
				System.out.println("C");
			}else if(30<=m+f && m+f<50){
				if(r>50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else{
				System.out.println("F");
			}
		}

	}

}

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

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

class Main{
    public static void main(String[] args)throw IOException{
        BuferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            
            String line = br.readLine();
            String[] sp1 = line.split(" ");
            
            int m = Integer.parseInt(sp1[0]);
            int f = Integer.parseInt(sp1[1]);
            int r = Integer.parseInt(sp1[2]);
            
            if(m == -1 && f == -1 && r == -1){
                break;
            }
            if(m == -1 || f == -1){
                System.out.println("F");
            }else if(m+f >= 80){
                System.out.println("A");
            }else if(m+f >= 65){
                System.out.println("B");
            }else if(m+f >= 50){
                System.out.println("C");
            }else if(m+f >= 30){
                System.out.println("D");
            }else{
                System.out.println("F");
            }
        }
    }
}

Compiler output:
Main.java:5: error: ';' expected
    public static void main(String[] args)throw IOException{
                                          ^
1 error
Language: Java

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

class Main{
    public static void main(String[] args)throw IOException{
        BuferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        while(true){
            
            String line = br.readLine();
            String[] sp1 = line.split(" ");
            
            int m = Integer.parseInt(sp1[0]);
            int f = Integer.parseInt(sp1[1]);
            int r = Integer.parseInt(sp1[2]);
            
            if(m == -1 && f == -1 && r == -1){
                break;
            }
            if(m == -1 || f == -1){
                System.out.println("F");
            }else if(m+f >= 80){
                System.out.println("A");
            }else if(m+f >= 65){
                System.out.println("B");
            }else if(m+f >= 50 || (m+f >=30) && r >= 50){
                System.out.println("C");
            }else if(m+f >= 30){
                System.out.println("D");
            }else{
                System.out.println("F");
            }
        }
    }
}

Compiler output:
Main.java:5: error: ';' expected
    public static void main(String[] args)throw IOException{
                                          ^
1 error