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

#include<iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: lvalue required as left operand of assignment
    8 |         if(m = -1 || f = -1) cout << 'F';
      |                ~~~^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
 int m, f, r;

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

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

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

 return 0;
}

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

#include <stdio.h>

void proc(int a,int b,int c){
  char r='F';
  if(a==-1||b==-1)r='F';
  else{
    if(a+b>=80)r='A';
	else if(a+b>=65)r='B';
	else if(a+b>=50)r='C';
	else if(a+b>=30){
	  r='D';
	  if(c>=50)r='C';
	}
  }
  printf("%c\n",r);
}

int main(){
  while(true){
    int a,b,c;
    scanf("%d%d%d", &a,&b,&c);
	if(a==-1&&b==-1&&c==-1)break;
	proc();
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: too few arguments to function 'void proc(int, int, int)'
   23 |         proc();
      |         ~~~~^~
a.cc:3:6: note: declared here
    3 | void proc(int a,int b,int c){
      |      ^~~~
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: expected '}' before 'else'
   18 |     else cout << "F" << endl;
      |     ^~~~
a.cc:15:21: note: to match this '{'
   15 |     else if(a >= 30){
      |                     ^
Language: C++

#include<stdio.h>
int main()
{
int m,n,r;
while(1){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: expected primary-expression before 'if'
   12 | else if(m+n>=30)(if(r>=50)printf("C\n");else printf("D\n");)
      |                  ^~
a.cc:12:18: error: expected ')' before 'if'
   12 | else if(m+n>=30)(if(r>=50)printf("C\n");else printf("D\n");)
      |                 ~^~
      |                  )
a.cc:12:60: error: expected primary-expression before ')' token
   12 | else if(m+n>=30)(if(r>=50)printf("C\n");else printf("D\n");)
      |                                                            ^
Language: C++

#include<stdio.h>
int main()
{
int m,n,r;
while(1){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected primary-expression before ')' token
    9 | if(m==-1||n==-1))printf("F\n");
      |                 ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n = 0;
	int a[n][3];
	a[n][0] = m;
	a[n][1] = f;
	a[n][2] = r;
	while(1){
		cin >> m >> f >> r;
		if(m == -1 && f == -1 && r == -1) break;
		else if(m + f >= 80){
			cout << A <<endl;
		}else if(m + f < 80 && m + f >= 65){
			cout << B << endl;
		}else if(m + f < 65 && m + f >= 50){
			cout << C << endl;
		}else if(m + f < 50 && m + f >= 30){
			if(r >= 50){
				cout << C << endl;
			}else{
				cout << D << endl;
			}
		}else if(m + f < 30){
			cout << F << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'm' was not declared in this scope
    7 |         a[n][0] = m;
      |                   ^
a.cc:8:19: error: 'f' was not declared in this scope
    8 |         a[n][1] = f;
      |                   ^
a.cc:9:19: error: 'r' was not declared in this scope
    9 |         a[n][2] = r;
      |                   ^
a.cc:14:33: error: 'A' was not declared in this scope
   14 |                         cout << A <<endl;
      |                                 ^
a.cc:16:33: error: 'B' was not declared in this scope
   16 |                         cout << B << endl;
      |                                 ^
a.cc:18:33: error: 'C' was not declared in this scope
   18 |                         cout << C << endl;
      |                                 ^
a.cc:21:41: error: 'C' was not declared in this scope
   21 |                                 cout << C << endl;
      |                                         ^
a.cc:23:41: error: 'D' was not declared in this scope
   23 |                                 cout << D << endl;
      |                                         ^
a.cc:26:33: error: 'F' was not declared in this scope
   26 |                         cout << F << endl;
      |                                 ^
Language: C++

#include <iostream>

int main(){
	int m,f,r;
	do{
		char result;
		std::cin>>m>>f>>r;
		if(m+f>=80){
			result='A';
		}else if(m+f>=65){
			result='B';
		}else if(m+f>=50){
			result='C';
		}else if(m+f>=30){
			result='D';
			if(r>=50){
				result='C';
			}
		}else{
			result='F';
		}
		std::cout<<result<<endl;
	}while(m!=-1&&f!=-1&&r!=-1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |                 std::cout<<result<<endl;
      |                                    ^~~~
      |                                    std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: lvalue required as left operand of assignment
    9 |             if ( m = (-1) && f = (-1) && r = (-1) );break;
      |                                  ~~~~~^~~~
a.cc:10:12: error: 'else' without a previous 'if'
   10 |            else{
      |            ^~~~
Language: C++

#include<iostream>
using namespace std;

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

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

import java.util.Scanner;

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:21:2: error: expected ';' after class definition
   21 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:5: error: 'final' was not declared in this scope
    5 |     final Scanner sc=new Scanner(System.in);
      |     ^~~~~
a.cc:7:17: error: 'sc' was not declared in this scope
    7 |         int m = sc.nextInt();
      |                 ^~
a.cc:18:9: error: 'System' was not declared in this scope
   18 |         System.out.println(G);
      |         ^~~~~~
Language: C++

import java.util.Scanner;

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:21:2: error: expected ';' after class definition
   21 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:5: error: 'final' was not declared in this scope
    5 |     final Scanner sc=new Scanner(System.in);
      |     ^~~~~
a.cc:7:17: error: 'sc' was not declared in this scope
    7 |         int m = sc.nextInt();
      |                 ^~
a.cc:18:9: error: 'System' was not declared in this scope
   18 |         System.out.println(G);
      |         ^~~~~~
Language: C++

while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    g = m + f
    if m == -1 or f == -1 or g < 30:
        print('F')
    elif g < 50 and r < 50:
        print('D')
    elif g < 65:
        print('C')
    elif g < 80:
        print('B')
    else:
        print('A')
~                    

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
    elif total < 50 and r < 50:
        print('D')
    elif total < 65:
        print('C')
    elif total < 80:
        print('B')
    else:
        print('A')
~                    

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
	int m,f,r,sum,j;
	char seiseki[];
	for(int i=0; ;i++){
		cin>>m>>f>>r;
		if(m==f==r==-1){
			break;
		}
			sum=m+f;
			if(sum>=80){
				seiseki[i]='A';
				j++;
			}
			else if(sum>=65){
				seiseki[i]='B';
				j++;
			}
			else if(sum>=50){
				seiseki[i]='C';
				j++;
			}
			else if(sum>=30){
			if(r>=50){
				seiseki[i]='C';
				j++;
			}
			else {
				seiseki[i]='D';
				j++;
			}
			}
			else if(sum<30){
				seiseki[i]='F';
				j++;
			}
		}
	for(i=0;i<j;i++){
		cout<<seiseki[i]<<" ";
			
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: storage size of 'seiseki' isn't known
    5 |         char seiseki[];
      |              ^~~~~~~
a.cc:39:13: error: 'i' was not declared in this scope
   39 |         for(i=0;i<j;i++){
      |             ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int m,f,r,sum,j;
	char seiseki[];
	for(int i=0; ;i++){
		cin>>m>>f>>r;
		if(m==f==r==-1){
			break;
		}
			sum=m+f;
			if(sum>=80){
				seiseki[i]='A';
				j++;
			}
			else if(sum>=65){
				seiseki[i]='B';
				j++;
			}
			else if(sum>=50){
				seiseki[i]='C';
				j++;
			}
			else if(sum>=30){
			if(r>=50){
				seiseki[i]='C';
				j++;
			}
			else {
				seiseki[i]='D';
				j++;
			}
			}
			else if(sum<30){
				seiseki[i]='F';
				j++;
			}
		}
	for(int i=0;i<j;i++){
		cout<<seiseki[i]<<" ";
			
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: storage size of 'seiseki' isn't known
    5 |         char seiseki[];
      |              ^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:28:32: error: expected '(' before '{' token
   28 |                         else if{
      |                                ^
      |                                (
Language: C++

#include "stdafx.h"
#include <iostream>
#define  N    101
using namespace std;

int main()
{ 
    int m=0,f=0,r=0;

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

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

    return 0;
}

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

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

Compiler output:
a.cc:4:1: error: 'in' does not name a type; did you mean 'int'?
    4 | in out(){
      | ^~
      | int
a.cc: In function 'int main()':
a.cc:28:1: error: 'out' was not declared in this scope
   28 | out();
      | ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: expected primary-expression at end of input
   34 |   return
      |         ^
a.cc:34:9: error: expected ';' at end of input
   34 |   return
      |         ^
      |         ;
a.cc:34:9: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){

int m[1000000],f[1000000],r[1000000];
char hyouka[1000000];
int a;

for(int i=1;i<1000000;i++){

cin>>m[i]>>f[i]>>r[i];
a++;

if(m[i]==-1 && f[i]==-1 && r[i]==-1){
goto aa;
}

if(m[i]==-1 || f[i]==-1){
hyouka[i]='F'
}

else if((m[i]+f[i])>=80){
hyouka[i]='A';
}
else if((m[i]+f[i])>=65){
hyouka[i]='B';
}

else if((m[i]+f[i])>=50){
hyouka[i]='C';
}

else if((m[i]+f[i])>=30 && r[i]<50){
hyouka[i]='D';
}
else if((m[i]+f[i])>=30 && r[i]>=50){
hyouka[i]='C';
}

else if((m[i]+f[i])<30){
hyouka[i]='F';
}

}

aa:;

for(int i=1;i<a;i++){

cout<<hyouka[i]<<endl;

}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected ';' before '}' token
   20 | hyouka[i]='F'
      |              ^
      |              ;
   21 | }
      | ~
Language: C++

#include<iostream>
#include<Windows.h>
using namespace std;

int main(){

const int MAX_NO=100000;
int m[MAX_NO],f[MAX_NO],r[MAX_NO];
char hyouka[MAX_NO];
int a=0;

sleep(1000);

for(int i=1;i<MAX_NO;i++){

cin>>m[i]>>f[i]>>r[i];

a++;

if(m[i]==-1 && f[i]==-1 && r[i]==-1){
goto aa;
}

if(m[i]==-1 || f[i]==-1){
hyouka[i]='F';
}

else if((m[i]+f[i])>=80){
hyouka[i]='A';
}
else if((m[i]+f[i])>=65){
hyouka[i]='B';
}

else if((m[i]+f[i])>=50){
hyouka[i]='C';
}

else if((m[i]+f[i])>=30 && r[i]<50){
hyouka[i]='D';
}
else if((m[i]+f[i])>=30 && r[i]>=50){
hyouka[i]='C';
}

else if((m[i]+f[i])<30){
hyouka[i]='F';
}

}

aa:;

for(int i=1;i<a;i++){


cout<<hyouka[i]<<endl;

}

return 0;
}

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

#include <iostream>
using namespace std;

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

	return 0;
}

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


int main()
{
	int m[100], f[100], r[100];
	int i = 0;

	while (1)
	{
		cin >> m[i] >> f[i] >> r[i];

		if (m[i] == -1 && f[i] == -1 && r[i] == -1)
		{
			break;
		}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'cin' was not declared in this scope
    9 |                 cin >> m[i] >> f[i] >> r[i];
      |                 ^~~
a.cc:18:25: error: 'cout' was not declared in this scope
   18 |                         cout << "A" << endl;
      |                         ^~~~
a.cc:18:40: error: 'endl' was not declared in this scope
   18 |                         cout << "A" << endl;
      |                                        ^~~~
a.cc:22:25: error: 'cout' was not declared in this scope
   22 |                         cout << "B" << endl;
      |                         ^~~~
a.cc:22:40: error: 'endl' was not declared in this scope
   22 |                         cout << "B" << endl;
      |                                        ^~~~
a.cc:26:25: error: 'cout' was not declared in this scope
   26 |                         cout << "C" << endl;
      |                         ^~~~
a.cc:26:40: error: 'endl' was not declared in this scope
   26 |                         cout << "C" << endl;
      |                                        ^~~~
a.cc:32:33: error: 'cout' was not declared in this scope
   32 |                                 cout << "C" << endl;
      |                                 ^~~~
a.cc:32:48: error: 'endl' was not declared in this scope
   32 |                                 cout << "C" << endl;
      |                                                ^~~~
a.cc:36:33: error: 'cout' was not declared in this scope
   36 |                                 cout << "D" << endl;
      |                                 ^~~~
a.cc:36:48: error: 'endl' was not declared in this scope
   36 |                                 cout << "D" << endl;
      |                                                ^~~~
a.cc:41:25: error: 'cout' was not declared in this scope
   41 |                         cout << "F" << endl;
      |                         ^~~~
a.cc:41:40: error: 'endl' was not declared in this scope
   41 |                         cout << "F" << endl;
      |                                        ^~~~
Language: C++

#include <iostream>
using namespace std;

char judge(int mid, int last, int re){
	int total;
	total = mid + last;
	if(80 <= total){
		return 'A';
	}else if(65 <= total && total < 80){
		return 'B';
	}else if(50 <= total && total < 65){
		return 'C';
	}else if(30 <= total && total < 50){
		return 'D';
		if(50 <= re){
			return 'C';
		}
	}else{
		return 'F';
	}
}

int _tmain(int argc, _TCHAR* argv[])
{
	int middle, last, re_ex;
	char record;
	while(true){
		cin >> middle >> last >> re_ex;
		if(middle == -1 && last == -1 && re_ex == -1){
			break;
		}
		record = judge(middle, last, re_ex);

		cout << record << endl;
	}

	return 0;
}

Compiler output:
a.cc:23:22: error: '_TCHAR' has not been declared
   23 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++

#include <iostream>
using namespace std;

char judge(int mid, int last, int re){
	int total;
	total = mid + last;
	if(80 <= total){
		return 'A';
	}else if(65 <= total && total < 80){
		return 'B';
	}else if(50 <= total && total < 65){
		return 'C';
	}else if(30 <= total && total < 50){
		return 'D';
		if(50 <= re){
			return 'C';
		}
	}else{
		return 'F';
	}
}

int _tmain()
{
	int middle, last, re_ex;
	char record;
	while(true){
		cin >> middle >> last >> re_ex;
		if(middle == -1 && last == -1 && re_ex == -1){
			break;
		}
		record = judge(middle, last, re_ex);

		cout << record << endl;
	}

	return 0;
}

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

#include <iostream>
using namespace std;

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

				

Compiler output:
a.cc:23:17: error: expected unqualified-id before 'return'
   23 |                 return 0;
      |                 ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int mid,final,re_exam;
    while (1){
    cin>>mid>>final>>re_exam;
    if(mid == -1 && final == -1 && re_exam==-1)break;
    int sum = mid + final;
    if( sum >= 80){cout<<"A"<<endl;}
    if ( 80 > sum >= 65 ){ cout<<"B"<<endl;}
    if (65 > sum >= 50) {cout<<"C"<<endl;}
    if (50 > sum >=35 && re_exam >= 50) {cout<<"C"<<endl;}
    if (50 > sum >=35 && re_exam < 50) {cout<<"D"<<endl;}
    if (30 > sum){cout<<"F"<<endl};
    if (mid == -1 or final == -1){cout <<"F"<<endl;}
    }
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:34: error: expected ';' before '}' token
   14 |     if (30 > sum){cout<<"F"<<endl};
      |                                  ^
      |                                  ;
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: 'r' was not declared in this scope
    6 |         while(m+f+r!=-3){
      |                   ^
Language: C++

#include<stdio.h>

void main(){
	int m=0,f=0,r=0;
	while(1){
		scanf("%d %d %d",&m,&f,&r);
		if(m==-1&&f==-1&&r==-1){
			break;
		}
		if(m==0||f==0){
			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");
		}
	}
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
Language: C++

#include "iostream"
using namespace std;

int main() {
	int m, f, r = 0;
	bool flag = true;

	while (flag == true) {
		cin >> m >> f >> r;
		if (m == -1 && f == -1 && r == -1) flag == false;
		else {
			if (m == -1 || f == -1) cout << "F";
			else if (m + f >= 80) cout << "A";
			else if (m + f >= 65)cout << "B";
			else if (m + f >= 50) cout << "C";
			else if (m + f >= 30 && r >= 50) cout << "C";
			else if (m + f >= 30)cout << "D";
			else cout << "F";
			
			cout << endl;
		}
	}
	return;
}

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

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

Compiler output:
a.cc: In function 'void print_grade(int, int, int)':
a.cc:7:9: error: 'cout' was not declared in this scope
    7 |         cout << "F";
      |         ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:9:9: error: 'cout' was not declared in this scope
    9 |         cout << "A";
      |         ^~~~
a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << "B";
      |         ^~~~
a.cc:11:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << "C";
      |         ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:13: error: 'cout' was not declared in this scope
   16 |             cout << "C";
      |             ^~~~
a.cc:16:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:13: error: 'cout' was not declared in this scope
   18 |             cout << "D";
      |             ^~~~
a.cc:18:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << "F";
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:13: error: 'endl' was not declared in this scope
   23 |     cout << endl;
      |             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc: In function 'int main()':
a.cc:29:9: error: 'cin' was not declared in this scope
   29 |         cin >> m >> f >> r;
      |         ^~~
a.cc:29:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'smmf' was not declared in this scope; did you mean 'summf'?
   14 |         if(65<=summf&&smmf<80){
      |                       ^~~~
      |                       summf
Language: C++

#include<iostream>
using namespace std;

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

		if (m == -1 && f == -1 && r == -1)
			break;
		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:
a.cc: In function 'int main()':
a.cc:25:17: error: 'else' without a previous 'if'
   25 |                 else cout << 'F' << endl;
      |                 ^~~~
a.cc: At global scope:
a.cc:28:9: error: expected unqualified-id before 'return'
   28 |         return 0;
      |         ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(void) {
	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:
a.cc: In function 'int main()':
a.cc:25:17: error: 'else' without a previous 'if'
   25 |                 else cout << 'F' << endl;
      |                 ^~~~
a.cc: At global scope:
a.cc:28:9: error: expected unqualified-id before 'return'
   28 |         return 0;
      |         ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
    int m, f, r;

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

    }while(m + f + r == -3);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:6: error: expected '}' before 'else'
   23 |     }else{
      |      ^~~~
a.cc:18:26: note: to match this '{'
   18 |     }else if(m + f >= 30){
      |                          ^
a.cc:29:2: error: expected 'while' at end of input
   29 | }
      |  ^
a.cc:29:2: error: expected '(' at end of input
   29 | }
      |  ^
      |  (
a.cc:29:2: error: expected primary-expression at end of input
a.cc:29:2: error: expected ')' at end of input
   29 | }
      |  ^
      |  )
a.cc:29:2: error: expected ';' at end of input
   29 | }
      |  ^
      |  ;
a.cc:29:2: error: expected '}' at end of input
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

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

Compiler output:
a.cc:7:28: warning: trigraph ??! ignored, use -trigraphs to enable [-Wtrigraphs]
    7 |                 if((m | f)???!= -1) cout << "F" << endl;
a.cc: In function 'int main()':
a.cc:7:28: error: expected primary-expression before '?' token
    7 |                 if((m | f)???!= -1) cout << "F" << endl;
      |                            ^
a.cc:7:29: error: expected primary-expression before '?' token
    7 |                 if((m | f)???!= -1) cout << "F" << endl;
      |                             ^
a.cc:7:30: error: expected primary-expression before '!=' token
    7 |                 if((m | f)???!= -1) cout << "F" << endl;
      |                              ^~
a.cc:7:35: error: expected ':' before ')' token
    7 |                 if((m | f)???!= -1) cout << "F" << endl;
      |                                   ^
      |                                   :
a.cc:7:35: error: expected primary-expression before ')' token
a.cc:7:35: error: expected ':' before ')' token
    7 |                 if((m | f)???!= -1) cout << "F" << endl;
      |                                   ^
      |                                   :
a.cc:7:35: error: expected primary-expression before ')' token
a.cc:7:35: error: expected ':' before ')' token
    7 |                 if((m | f)???!= -1) cout << "F" << endl;
      |                                   ^
      |                                   :
a.cc:7:35: error: expected primary-expression before ')' token
Language: C++

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

Compiler output:
a.cc:7:28: warning: trigraph ??= ignored, use -trigraphs to enable [-Wtrigraphs]
    7 |                 if((m | f)???== -1) cout << "F" << endl;
a.cc: In function 'int main()':
a.cc:7:28: error: expected primary-expression before '?' token
    7 |                 if((m | f)???== -1) cout << "F" << endl;
      |                            ^
a.cc:7:29: error: expected primary-expression before '?' token
    7 |                 if((m | f)???== -1) cout << "F" << endl;
      |                             ^
a.cc:7:30: error: expected primary-expression before '==' token
    7 |                 if((m | f)???== -1) cout << "F" << endl;
      |                              ^~
a.cc:7:35: error: expected ':' before ')' token
    7 |                 if((m | f)???== -1) cout << "F" << endl;
      |                                   ^
      |                                   :
a.cc:7:35: error: expected primary-expression before ')' token
a.cc:7:35: error: expected ':' before ')' token
    7 |                 if((m | f)???== -1) cout << "F" << endl;
      |                                   ^
      |                                   :
a.cc:7:35: error: expected primary-expression before ')' token
a.cc:7:35: error: expected ':' before ')' token
    7 |                 if((m | f)???== -1) cout << "F" << endl;
      |                                   ^
      |                                   :
a.cc:7:35: error: expected primary-expression before ')' token
Language: C++

#include<iostream>

using namespace std;

char getGrade( int m, int f, int r){

	int sum = m + f;

	char grade;

	if( m == -1 || f == -1) {

		grade = 'A';

	}	else if ( 80 <= sum) {

		grade = 'B';

	}	else if( 65 <= sum && sum < 80) {

		grade = 'B';

	}	else if( 50 <= sum && sum < 65) {

		grade = 'C';

	}	else if ( 30 <= sum && sum < 50) {

		if( 50 <= r) grade = 'C';

		else grade = 'D';

	}	else if (sum < 30) {

		grade = 'F';

	}

	return grade;

}

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

#include<iostream>
using namespace std;

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

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

???#include <iostream>
using namespace std ;
int main(){
	int m , f , r , x , y ;
	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 >= 50 && m + f < 65 )
			cout << "C" << endl ;
		else if ( m + f >= 30 && m + f < 50 && r > 50 )
			cout << "C" << endl ;
		else if ( m + f >= 30 && m + f < 50 )
			cout << "D" << endl ;
		else if ( m + f < 30 )
			cout << "F" << endl ;
		}
}

Compiler output:
a.cc:1:4: error: stray '#' in program
    1 | ???#include <iostream>
      |    ^
a.cc:1:1: error: expected unqualified-id before '?' token
    1 | ???#include <iostream>
      | ^
a.cc: In function 'int main()':
a.cc:6:17: error: 'cin' was not declared in this scope
    6 |                 cin >> m >> f >> r ;
      |                 ^~~
a.cc:9:25: error: 'cout' was not declared in this scope
    9 |                         cout << "F" << endl ;
      |                         ^~~~
a.cc:9:40: error: 'endl' was not declared in this scope
    9 |                         cout << "F" << endl ;
      |                                        ^~~~
a.cc:11:25: error: 'cout' was not declared in this scope
   11 |                         cout << "A" << endl ;
      |                         ^~~~
a.cc:11:40: error: 'endl' was not declared in this scope
   11 |                         cout << "A" << endl ;
      |                                        ^~~~
a.cc:13:25: error: 'cout' was not declared in this scope
   13 |                         cout << "B" << endl ;
      |                         ^~~~
a.cc:13:40: error: 'endl' was not declared in this scope
   13 |                         cout << "B" << endl ;
      |                                        ^~~~
a.cc:15:25: error: 'cout' was not declared in this scope
   15 |                         cout << "C" << endl ;
      |                         ^~~~
a.cc:15:40: error: 'endl' was not declared in this scope
   15 |                         cout << "C" << endl ;
      |                                        ^~~~
a.cc:17:25: error: 'cout' was not declared in this scope
   17 |                         cout << "C" << endl ;
      |                         ^~~~
a.cc:17:40: error: 'endl' was not declared in this scope
   17 |                         cout << "C" << endl ;
      |                                        ^~~~
a.cc:19:25: error: 'cout' was not declared in this scope
   19 |                         cout << "D" << endl ;
      |                         ^~~~
a.cc:19:40: error: 'endl' was not declared in this scope
   19 |                         cout << "D" << endl ;
      |                                        ^~~~
a.cc:21:25: error: 'cout' was not declared in this scope
   21 |                         cout << "F" << endl ;
      |                         ^~~~
a.cc:21:40: error: 'endl' was not declared in this scope
   21 |                         cout << "F" << endl ;
      |                                        ^~~~
Language: C++

#include<iostream>
using namespace std;

getGrade(int m,int f, int r){

  int sum = m + f;
  char grade;

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

  return grade;
}

int main() {

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

  return 0;
}

Compiler output:
a.cc:4:1: error: ISO C++ forbids declaration of 'getGrade' with no type [-fpermissive]
    4 | getGrade(int m,int f, int r){
      | ^~~~~~~~
Language: C++

#include<stdio.h>
int main(){
  int m,f,r,x;

  while(1){
    scanf("%d %d %d",&m,&f,&r);
    (x=m+f);
    if(m==f&&f==r&&r==-1y){
      break;
    }

    
    if(x<30){
      printf("F\n");
    }else if(m==-1){
	printf("F\n");
      }else if(f==-1){
	printf("F\n");
      }else if(30<=x&&x<50){
	printf("D\n");
      }else if(50<=x&&x<65){
	printf("C\n");
      }else if(65<=x&&x<80){
	printf("B\n");
      }else if(80<=x){
	printf("A\n");
      }else if(30<=x&&x<50,r<=50){
	printf("C\n");
      }
  }
  return 0;
}
    
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: unable to find numeric literal operator 'operator""y'
    8 |     if(m==f&&f==r&&r==-1y){
      |                        ^~
Language: C++

while 1:
    m,f,r = map(int, input().split())
    if m == f == r == -1: break

    if m+f >= 80:
        print("A")
    elif 65 <= m+f < 80:
        print("B")
    elif 50 <= m+f < 65:
        print("C")
    elif 30 <= m+f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    elif m==-1 or f==-1 or (m+f < 30):
        print("F")

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
Language: C++

while 1:
    m,f,r = map(int, input().split())
    if m == f == r == -1: break

    if m+f >= 80:
        print("A")
    elif 65 <= m+f < 80:
        print("B")
    elif 50 <= m+f < 65:
        print("C")
    elif 30 <= m+f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
Language: C++

#include <iostream>

using namespace std;



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

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