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

#include <iostream>

int main()
{
	int a[3];
	char grade;
	while (true) {
	    std::cin >> a[0] >> a[1] >> a[2];
	    a[3] = a[0] + a[1];
	    if (a[2] == -1 && a[3] == -2) {
	    	break;
	    }	    
	    if (a[3] >= 80) grade = "A";
	    else if (a[3] < 80 && a[3] >= 65) grade = "B";
	    else if (a[3] < 65 && a[3] >= 50) grade = "C";
	    else if (a[3] < 50 && a[3] >= 30) grade = "D";
	    else if (a[3] < 30) grade = "E";
	    if (grade == "D") {
	    	if (a[2] >= 50) {
	    		grade = "C";
	    	}
	    }
	    if (a[0] == -1 || a[1] == -1) {
	    	grade = "F";
	    }
 	    std::cout << grade << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:37: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   13 |             if (a[3] >= 80) grade = "A";
      |                                     ^~~
      |                                     |
      |                                     const char*
a.cc:14:55: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   14 |             else if (a[3] < 80 && a[3] >= 65) grade = "B";
      |                                                       ^~~
      |                                                       |
      |                                                       const char*
a.cc:15:55: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   15 |             else if (a[3] < 65 && a[3] >= 50) grade = "C";
      |                                                       ^~~
      |                                                       |
      |                                                       const char*
a.cc:16:55: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   16 |             else if (a[3] < 50 && a[3] >= 30) grade = "D";
      |                                                       ^~~
      |                                                       |
      |                                                       const char*
a.cc:17:41: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   17 |             else if (a[3] < 30) grade = "E";
      |                                         ^~~
      |                                         |
      |                                         const char*
a.cc:18:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |             if (grade == "D") {
      |                 ~~~~~~^~~~~~
a.cc:20:33: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   20 |                         grade = "C";
      |                                 ^~~
      |                                 |
      |                                 const char*
a.cc:24:25: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   24 |                 grade = "F";
      |                         ^~~
      |                         |
      |                         const char*
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:29:16: error: 'i' was not declared in this scope
   29 |     if(sum<30&&i==0){
      |                ^
Language: C++

#include<iostream>
using namespace std;
int main() {
	int m, f, r;
	cin >> m >> f >> r;
	if (m + f > 79) {
		cout << A;
		
	}
	if (64 < m + f < 80) {
		cout << B;

	}
	if (49 < m + f < 65) {
		cout << C;

	}
	if (29 < m + f < 50) {
		cout << D;
	else(r > 49) {
		cout << C;
	}
	}
	if (m + f < 30) {
		cout << F;

	}
	if (m || f == -1) {
		cout << F;
	else(m==-1&&f==-1&&r==-1)
		break

	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: 'A' was not declared in this scope
    7 |                 cout << A;
      |                         ^
a.cc:11:25: error: 'B' was not declared in this scope
   11 |                 cout << B;
      |                         ^
a.cc:15:25: error: 'C' was not declared in this scope
   15 |                 cout << C;
      |                         ^
a.cc:19:25: error: 'D' was not declared in this scope
   19 |                 cout << D;
      |                         ^
a.cc:20:9: error: expected '}' before 'else'
   20 |         else(r > 49) {
      |         ^~~~
a.cc:18:30: note: to match this '{'
   18 |         if (29 < m + f < 50) {
      |                              ^
a.cc:20:21: error: expected ';' before '{' token
   20 |         else(r > 49) {
      |                     ^~
      |                     ;
a.cc: At global scope:
a.cc:24:9: error: expected unqualified-id before 'if'
   24 |         if (m + f < 30) {
      |         ^~
a.cc:28:9: error: expected unqualified-id before 'if'
   28 |         if (m || f == -1) {
      |         ^~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main() {
	int m, f, r;
	cin >> m >> f >> r;
	if (m + f > 79) {
		cout << A;
		
	}
	if (64 < m + f < 80) {
		cout << B;

	}
	if (49 < m + f < 65) {
		cout << C;

	}
	if (29 < m + f < 50) {
		cout << D;
	else(r > 49) {
		cout << C;
	}
	}
	if (m + f < 30) {
		cout << F;

	}
	if (m || f == -1) {
		cout << F;
	else(m==-1&&f==-1&&r==-1)
		break

	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: 'A' was not declared in this scope
    7 |                 cout << A;
      |                         ^
a.cc:11:25: error: 'B' was not declared in this scope
   11 |                 cout << B;
      |                         ^
a.cc:15:25: error: 'C' was not declared in this scope
   15 |                 cout << C;
      |                         ^
a.cc:19:25: error: 'D' was not declared in this scope
   19 |                 cout << D;
      |                         ^
a.cc:20:9: error: expected '}' before 'else'
   20 |         else(r > 49) {
      |         ^~~~
a.cc:18:30: note: to match this '{'
   18 |         if (29 < m + f < 50) {
      |                              ^
a.cc:20:21: error: expected ';' before '{' token
   20 |         else(r > 49) {
      |                     ^~
      |                     ;
a.cc: At global scope:
a.cc:24:9: error: expected unqualified-id before 'if'
   24 |         if (m + f < 30) {
      |         ^~
a.cc:28:9: error: expected unqualified-id before 'if'
   28 |         if (m || f == -1) {
      |         ^~
a.cc:34:9: error: expected unqualified-id before 'return'
   34 |         return 0;
      |         ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main() {
	int m, f, r;
	cin >> m >> f >> r;
	for (;;) {
		if (m + f > 79) {
			cout << A;

		}
		if (64 < m + f < 80) {
			cout << B;

		}
		if (49 < m + f < 65) {
			cout << C;

		}
		if (29 < m + f < 50) {
			cout << D;
		else(r > 49) {
			cout << C;
		}
		}
		if (m + f < 30) {
			cout << F;

		}
		if (m || f == -1) {
			cout << F;
		else(m == -1 && f == -1 && r == -1)
			break

		}
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:33: error: 'A' was not declared in this scope
    8 |                         cout << A;
      |                                 ^
a.cc:12:33: error: 'B' was not declared in this scope
   12 |                         cout << B;
      |                                 ^
a.cc:16:33: error: 'C' was not declared in this scope
   16 |                         cout << C;
      |                                 ^
a.cc:20:33: error: 'D' was not declared in this scope
   20 |                         cout << D;
      |                                 ^
a.cc:21:17: error: expected '}' before 'else'
   21 |                 else(r > 49) {
      |                 ^~~~
a.cc:19:38: note: to match this '{'
   19 |                 if (29 < m + f < 50) {
      |                                      ^
a.cc:21:29: error: expected ';' before '{' token
   21 |                 else(r > 49) {
      |                             ^~
      |                             ;
a.cc:26:33: error: 'F' was not declared in this scope
   26 |                         cout << F;
      |                                 ^
a.cc:30:33: error: 'F' was not declared in this scope
   30 |                         cout << F;
      |                                 ^
a.cc:31:17: error: expected '}' before 'else'
   31 |                 else(m == -1 && f == -1 && r == -1)
      |                 ^~~~
a.cc:29:35: note: to match this '{'
   29 |                 if (m || f == -1) {
      |                                   ^
a.cc:31:52: error: expected ';' before 'break'
   31 |                 else(m == -1 && f == -1 && r == -1)
      |                                                    ^
      |                                                    ;
   32 |                         break
      |                         ~~~~~                       
a.cc: At global scope:
a.cc:35:9: error: expected declaration before '}' token
   35 |         }
      |         ^
a.cc:36:9: error: expected unqualified-id before 'return'
   36 |         return 0;
      |         ^~~~~~
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main() {
	int m, f, r;
	cin >> m >> f >> r;
	while(m !=-1&&f!=-1&&r!=-1){
		cin >> m >> f >> r;
			if (m || f == -1) {
			cout << F;
			}
			if (m + f > 79) {
				cout << A<<endl;
			}
			if (64 < m + f < 80) {
				cout << B<<endl;

			}
			if (49 < m + f < 65) {
				cout << C<<endl;

			}
			if (29 < m + f < 50 && r < 50) {
				cout << D<<endl;
			}
			if (29 < m + f < 50 && r >= 50){
				cout << C<<endl;
			}
			if (m + f < 30) {
				cout << F<<endl;

			}
			
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: 'F' was not declared in this scope
    9 |                         cout << F;
      |                                 ^
a.cc:12:41: error: 'A' was not declared in this scope
   12 |                                 cout << A<<endl;
      |                                         ^
a.cc:15:41: error: 'B' was not declared in this scope
   15 |                                 cout << B<<endl;
      |                                         ^
a.cc:19:41: error: 'C' was not declared in this scope
   19 |                                 cout << C<<endl;
      |                                         ^
a.cc:23:41: error: 'D' was not declared in this scope
   23 |                                 cout << D<<endl;
      |                                         ^
a.cc:26:41: error: 'C' was not declared in this scope
   26 |                                 cout << C<<endl;
      |                                         ^
a.cc:29:41: error: 'F' was not declared in this scope
   29 |                                 cout << F<<endl;
      |                                         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: 'F' was not declared in this scope
   11 |                             g == F;
      |                                  ^
a.cc:13:34: error: 'A' was not declared in this scope
   13 |                             g == A;
      |                                  ^
a.cc:15:34: error: 'B' was not declared in this scope
   15 |                             g == B;
      |                                  ^
a.cc:17:34: error: 'C' was not declared in this scope
   17 |                             g == C;
      |                                  ^
a.cc:20:38: error: 'C' was not declared in this scope
   20 |                                 g == C;
      |                                      ^
a.cc:21:39: error: expected '(' before '{' token
   21 |                             } else if {
      |                                       ^
      |                                       (
a.cc:24:25: error: expected '}' before 'else'
   24 |                         else {
      |                         ^~~~
a.cc:18:54: note: to match this '{'
   18 |                         } else if (50 > m + f >= 30) {
      |                                                      ^
a.cc:25:34: error: 'F' was not declared in this scope
   25 |                             g == F;
      |                                  ^
Language: C++

import java.util.Scanner;

public class Main {
	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;
			if (m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if (80 <= m + f) {
				System.out.println("A");
			} else if (m + f < 80) {
				if (65 <= m + f) {
					System.out.println("B");
				} else if (m + f < 65) {
					if (50 <= m + f) {
						System.out.println("C");
					} else if (m + f < 50) {
						if (30 <= m + f) {
							if (50 <= r) {
								System.out.println("C");
							} else {
								System.out.println("D");
							}
						} else if (m + f < 30) {
							System.out.println("F");
						}
					}
				}
			}
		}
	}
}

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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			double m = sc.nextDouble();
			double f = sc.nextDouble();
			double r = sc.nextDouble();
			if (m == -1 && f == -1 && r == -1) {
				break;
			}if (m == -1 && f == -1) {
				System.out.println("F");
			}
			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:
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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;
public class Main {
	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;
		}
		
		if(m==-1||f==-1){
			System.out.println("F");
		}
		else if(m+f>=80){
			System.out.println("A");
		}
		else if(m+f>=65&&m+f<80){
			System.out.println("B");
		}
		else if(m+f<30){
			System.out.println("F");
		}
		else if(m+f>=50&&m+f<65&&r>=50){
			System.out.println("C");
		}
		else if(m+f>=50&&m+f<65&&r<=50){
				System.out.println("D");
		}
		
		System.out.println("\n");
		}
	}
}

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:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include <cstdio>

int main(void) {
	while(true) {
		int x, y, z;
		char rank;
		scanf("%d %d %d", &x, &y, &z);
		if(x == -1 && y == -1 && z == -1)
			break;
		if(x + y >= 80)
			rank = 'A';
		else if( x + y >= 65)
			rank = 'B';
		else if( x + y >= 50)
			rank = 'C';
		else if( x + y >= 30) {
			rank = z >= 50 ? 'C' : 'D';
		else
			rank = 'F';
		printf("%c\n", rank);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: expected '}' before 'else'
   18 |                 else
      |                 ^~~~
a.cc:16:39: note: to match this '{'
   16 |                 else if( x + y >= 30) {
      |                                       ^
Language: C++

#include<iostream>
using namespace std;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:31: error: 'j' was not declared in this scope
   25 |                 cout <<jud(m, j, r)<<endl;
      |                               ^
Language: C++

#include<iostream>
using namespace std;

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

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

//AOJ10016
//Grading

#include <stdio.h>

int main (){

while (1){
	
	int m, f, r;
	int p;

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

	p = m + f;

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

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

}

return 0;

}	
	
		

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: expected primary-expression before '>=' token
   21 |         }else if ( >=80 ){
      |                    ^~
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'c' was not declared in this scope
    6 | while(cin >> m >> f >> c , (0<=m)&&(0<=f)&&(0<=c)){
      |                        ^
Language: C++

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: 'M' was not declared in this scope
    7 |       scanf("%d %d %d",&M,&f,&r);
      |                         ^
Language: C++

#include<stdio.h>

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

Compiler output:
a.cc:9:20: warning: missing terminating " character
    9 |                 if("m==-1&&f==-1&&r==-1)
      |                    ^
a.cc:9:20: error: missing terminating " character
    9 |                 if("m==-1&&f==-1&&r==-1)
      |                    ^~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:17: error: expected primary-expression before '{' token
   10 |                 {
      |                 ^
a.cc:14:22: error: expected ')' before ';' token
   14 |                 j=m+f;
      |                      ^
      |                      )
a.cc:9:19: note: to match this '('
    9 |                 if("m==-1&&f==-1&&r==-1)
      |                   ^
a.cc:17:60: error: expected ';' before 'printf'
   17 |                 else if((j>=50&&j<65)||(j>=30&&j<50&&r>=50)printf("C\n");
      |                                                            ^~~~~~
      |                                                            ;
a.cc:18:17: error: expected primary-expression before 'else'
   18 |                 else if(j>=30&&j<50)printf("D\n");
      |                 ^~~~
a.cc:17:74: error: expected ')' before 'else'
   17 |                 else if((j>=50&&j<65)||(j>=30&&j<50&&r>=50)printf("C\n");
      |                        ~                                                 ^
      |                                                                          )
   18 |                 else if(j>=30&&j<50)printf("D\n");
      |                 ~~~~
Language: C++

#include<stdio.h>

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

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

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: expected ';' before 'printf'
   24 |                 else (j<30)printf("F\n");
      |                            ^~~~~~
      |                            ;
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:38: error: expected primary-expression before ')' token
   14 | else if(r<80&&r>=65){cout<<"B"<<endl;)
      |                                      ^
a.cc:16:1: error: expected '}' before 'else'
   16 | else if(r<50&&r>=30){cout<<"D"<<endl;}
      | ^~~~
a.cc:14:21: note: to match this '{'
   14 | else if(r<80&&r>=65){cout<<"B"<<endl;)
      |                     ^
Language: C++

#include<iostream>
using namespace std;
 
int main()
{
    while(true)
       {
        int m, f, r;
        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) 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:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
 
int main()
{
    while(true)
       {
        int m, f, r;
        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) 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:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<iostream>
#include<queue>
using namespace std;
class test{
	public:
		int firstExam;
		int secondExam;
		int addtionalExam;
		test();
};

test::test()
	:firstExam(0),
	secondExam(0),
	addtionalExam(0)
{};

char score(test student){
	if(student.firstExam == -1 && student.secondExam == -1)return 'F';
	int score = student.firstExam + student.secondExam;
	if(score >= 80)return 'A';
	if(score >= 65)return 'B';
	if(score >= 50)return 'C';
	if(score >= 30 && student.addtionalExam >= 50)return'C';
	if(score >= 30)return 'D';
	else return 'F';
	return 'F';
}
int main(void){
	int firstBuf;
	int secondBuf;
	int addtionalBuf;
	test student;
	queue<test> students;

	for(;;){
		cin >> firstBuf >> secondBuf >> addtionalBuf;
		if(firstBuf == -1 && secondBuf == -1 && addtionalBuf == -1)break;
		student.firstExam = firstBuf;
		student.secondExam = secondBuf;
		student.addtionalExam = addtionalBuf;
		students.push(student);
	}

	while(!students.empty()){
		cout << score(students.front()) << endl;
		stu

Compiler output:
a.cc: In function 'int main()':
a.cc:47:17: error: 'stu' was not declared in this scope; did you mean 'std'?
   47 |                 stu
      |                 ^~~
      |                 std
a.cc:47:20: error: expected '}' at end of input
   47 |                 stu
      |                    ^
a.cc:45:33: note: to match this '{'
   45 |         while(!students.empty()){
      |                                 ^
a.cc:47:20: error: expected '}' at end of input
   47 |                 stu
      |                    ^
a.cc:29:15: note: to match this '{'
   29 | int main(void){
      |               ^
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;
		}	
		else 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)) && (r >= 50)){
			cout << "C" << endl;
		}
		else if((m + f >= 30) && (r < 50)){
			cout << "D" << endl;
		}
		else if(30 > m + f){
			cout << "F" << endl;
		}
	}
	return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:43: error: expected identifier before '(' token
   22 |                 else if((m + f >= 30)) && (r >= 50)){
      |                                           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected '(' before 'else'
   11 |                 }if else(m+f>=80){
      |                     ^~~~
      |                     (
a.cc:13:21: error: expected '(' before 'else'
   13 |                 }if else(m+f>=65&&m+f<80){
      |                     ^~~~
      |                     (
a.cc:15:21: error: expected '(' before 'else'
   15 |                 }if else(m+f>=50&&m+f<65,m+f<65||m+f<50,m+f<50&&r>=50){
      |                     ^~~~
      |                     (
a.cc:17:21: error: expected '(' before 'else'
   17 |                 }if else(m+f>=30&&m+f<50){
      |                     ^~~~
      |                     (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected '(' before 'else'
   11 |                 }if else (m+f>=80){
      |                     ^~~~
      |                     (
a.cc:13:21: error: expected '(' before 'else'
   13 |                 }if else (m+f>=65&&m+f<80){
      |                     ^~~~
      |                     (
a.cc:15:21: error: expected '(' before 'else'
   15 |                 }if else (m+f>=50&&m+f<65,m+f<65||m+f<50,m+f<50&&r>=50){
      |                     ^~~~
      |                     (
a.cc:17:21: error: expected '(' before 'else'
   17 |                 }if else (m+f>=30&&m+f<50){
      |                     ^~~~
      |                     (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: expected '(' before 'else'
   12 |                 }if else (m+f>=80){
      |                     ^~~~
      |                     (
a.cc:14:21: error: expected '(' before 'else'
   14 |                 }if else (m+f>=65&&m+f<80){
      |                     ^~~~
      |                     (
a.cc:16:21: error: expected '(' before 'else'
   16 |                 }if else (m+f>=50&&m+f<65,m+f<65||m+f<50,m+f<50&&r>=50){
      |                     ^~~~
      |                     (
a.cc:18:21: error: expected '(' before 'else'
   18 |                 }if else (m+f>=30&&m+f<50){
      |                     ^~~~
      |                     (
Language: C++

#include <iostream>
#include "StdAfx.h"

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

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

#include <algorithm>
#include<iostream>
using namespace std;
int main()
{
	while(true)
	{
	int m, f, r;
	cin >> m >> f >> r;
	int p = m+f;
	if(m == -1 && f == -1 && r == -1)
		break;
	if(m == -1 || f == -1)
	{
		cout << "F" << endl;
	}
	
	else if(p >= 80)
	{
		cout << "A" << endl;
	}
	else if(p >= 65)
	{
		cout << "B" << endl;
	}
	else if(p >= 50)
	{
		cout << "C" << endl;
	}
	else if(p >= 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:33:35: error: expected primary-expression before '<<' token
   33 |                 else cout << "D"; << endl;
      |                                   ^~
Language: C++

#include <iostream>

using namespace std;

int main (){

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

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: expected ';' before 'cout'
   21 |                 else (p<30)cout<<"F"<<endl;
      |                            ^~~~
      |                            ;
Language: C++

#include<iostream>
using namespace std;

int main(){

	int m,f,r;
	int s;
	while(1){

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'else' without a previous 'if'
   17 |                 else if(s>=80){
      |                 ^~~~
Language: C++

int main() {
	int m,f,r;
	char grade[]={'A','B','C','D','F'};
	while(1){
		cin >> m >> ws >> f >> ws >> r;
		if(m<MIN_MF||MAX_MF<m||f<MIN_MF||MAX_MF<f||r<MIN_R||MAX_R<r)
			break;
		if(m==-1 && f==-1 && r==-1)
			break;
		char result;
		if(m==-1||f==-1)
			result = grade[F];
		else if(m+f>=80)
			result = grade[A];
		else if(m+f>=65)
			result = grade[B];
		else if(m+f>=50)
			result = grade[C];
		else if(m+f>=30){
			if(r>=50)
				result = grade[C];
			else
				result = grade[D];
		}else
			result = grade[F];
		cout << result;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope
    5 |                 cin >> m >> ws >> f >> ws >> r;
      |                 ^~~
a.cc:5:29: error: 'ws' was not declared in this scope
    5 |                 cin >> m >> ws >> f >> ws >> r;
      |                             ^~
a.cc:6:22: error: 'MIN_MF' was not declared in this scope
    6 |                 if(m<MIN_MF||MAX_MF<m||f<MIN_MF||MAX_MF<f||r<MIN_R||MAX_R<r)
      |                      ^~~~~~
a.cc:6:30: error: 'MAX_MF' was not declared in this scope
    6 |                 if(m<MIN_MF||MAX_MF<m||f<MIN_MF||MAX_MF<f||r<MIN_R||MAX_R<r)
      |                              ^~~~~~
a.cc:6:62: error: 'MIN_R' was not declared in this scope
    6 |                 if(m<MIN_MF||MAX_MF<m||f<MIN_MF||MAX_MF<f||r<MIN_R||MAX_R<r)
      |                                                              ^~~~~
a.cc:6:69: error: 'MAX_R' was not declared in this scope
    6 |                 if(m<MIN_MF||MAX_MF<m||f<MIN_MF||MAX_MF<f||r<MIN_R||MAX_R<r)
      |                                                                     ^~~~~
a.cc:12:40: error: 'F' was not declared in this scope
   12 |                         result = grade[F];
      |                                        ^
a.cc:14:40: error: 'A' was not declared in this scope
   14 |                         result = grade[A];
      |                                        ^
a.cc:16:40: error: 'B' was not declared in this scope
   16 |                         result = grade[B];
      |                                        ^
a.cc:18:40: error: 'C' was not declared in this scope
   18 |                         result = grade[C];
      |                                        ^
a.cc:21:48: error: 'C' was not declared in this scope
   21 |                                 result = grade[C];
      |                                                ^
a.cc:23:48: error: 'D' was not declared in this scope
   23 |                                 result = grade[D];
      |                                                ^
a.cc:25:40: error: 'F' was not declared in this scope
   25 |                         result = grade[F];
      |                                        ^
a.cc:26:17: error: 'cout' was not declared in this scope
   26 |                 cout << result;
      |                 ^~~~
Language: C++

#include <iostream>
using namespace std;

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

	return 0;
}

Compiler output:
a.cc:9:21: error: extended character 　 is not valid in an identifier
    9 |              if(m==-1　&& f==-1) break;
      |                     ^
a.cc:10:25: error: extended character 　 is not valid in an identifier
   10 |              if(m==-1 ||　f==-1) cout <<F<<endl;
      |                         ^
a.cc: In function 'int main()':
a.cc:9:21: error: unable to find numeric literal operator 'operator""\U00003000'
    9 |              if(m==-1　&& f==-1) break;
      |                     ^~~
a.cc:10:25: error: '\U00003000f' was not declared in this scope
   10 |              if(m==-1 ||　f==-1) cout <<F<<endl;
      |                         ^~~
a.cc:10:41: error: 'F' was not declared in this scope
   10 |              if(m==-1 ||　f==-1) cout <<F<<endl;
      |                                         ^
a.cc:11:31: error: 'A' was not declared in this scope
   11 |              if(s>= 80) cout<<A<<endl;
      |                               ^
a.cc:12:38: error: 'B' was not declared in this scope
   12 |              if(s<80 && s>=65) cout<<B<<endl;
      |                                      ^
a.cc:13:38: error: 'C' was not declared in this scope
   13 |              if(s<65 && s>=50) cout<<C<<endl;
      |                                      ^
a.cc:14:47: error: 'C' was not declared in this scope
   14 |              if(s<50 && s>=30 && r>=50) cout<<C<<endl;
      |                                               ^
a.cc:15:47: error: 'D' was not declared in this scope
   15 |              if(s<50 && s>=30 && r<50) cout <<D<<endl;
      |                                               ^
a.cc:16:29: error: 'F' was not declared in this scope
   16 |              if(s<30) cout<<F<<endl;
      |                             ^
Language: C++

#include <iostream>
using namespace std;

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

	return 0;
}

Compiler output:
a.cc:9:21: error: extended character 　 is not valid in an identifier
    9 |              if(m==-1　&& f==-1) break;
      |                     ^
a.cc:10:25: error: extended character 　 is not valid in an identifier
   10 |              if(m==-1 ||　f==-1) cout <<"F"<<endl;
      |                         ^
a.cc: In function 'int main()':
a.cc:9:21: error: unable to find numeric literal operator 'operator""\U00003000'
    9 |              if(m==-1　&& f==-1) break;
      |                     ^~~
a.cc:10:25: error: '\U00003000f' was not declared in this scope
   10 |              if(m==-1 ||　f==-1) cout <<"F"<<endl;
      |                         ^~~
Language: C++

#include <iostream>
using namespace std;

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

	return 0;
}

Compiler output:
a.cc:10:25: error: extended character 　 is not valid in an identifier
   10 |              if(m==-1 ||　f==-1) cout <<"F"<<endl;
      |                         ^
a.cc: In function 'int main()':
a.cc:10:25: error: '\U00003000f' was not declared in this scope
   10 |              if(m==-1 ||　f==-1) cout <<"F"<<endl;
      |                         ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int m,f,r,s;
        while(1){
             cin>>m>>f>>r;
             s=m+f;
             if(m==-1 && f==-1) break;{
             else 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 && r>=50) cout<<"C"<<endl;{
             else if(s>=30 && r<50) cout <<"D"<<endl;{
             else if(s<30) cout<<"F"<<endl;{
         }}}}}}}}}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'else' without a previous 'if'
   10 |              else if(m==-1 || f==-1) cout <<"F"<<endl;{
      |              ^~~~
a.cc:11:14: error: 'else' without a previous 'if'
   11 |              else if(s>= 80) cout<<"A"<<endl;{
      |              ^~~~
a.cc:12:14: error: 'else' without a previous 'if'
   12 |              else if(s>=65) cout<<"B"<<endl;{
      |              ^~~~
a.cc:13:14: error: 'else' without a previous 'if'
   13 |              else if(s>=50) cout<<"C"<<endl;{
      |              ^~~~
a.cc:14:14: error: 'else' without a previous 'if'
   14 |              else if(s>=30 && r>=50) cout<<"C"<<endl;{
      |              ^~~~
a.cc:15:14: error: 'else' without a previous 'if'
   15 |              else if(s>=30 && r<50) cout <<"D"<<endl;{
      |              ^~~~
a.cc:16:14: error: 'else' without a previous 'if'
   16 |              else if(s<30) cout<<"F"<<endl;{
      |              ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int m,f,r,s;
        while(1){
             cin>>m>>f>>r;
             s=m+f;
             if(m==-1 && f==-1) break;{
             else 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 && r>=50) cout<<"C"<<endl;{
             else if(s>=30 && r<50) cout <<"D"<<endl;}{
             else if(s<30) cout<<"F"<<endl;}
         }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'else' without a previous 'if'
   10 |              else if(m==-1 || f==-1) cout <<"F"<<endl;}{
      |              ^~~~
a.cc:11:14: error: 'else' without a previous 'if'
   11 |              else if(s>= 80) cout<<"A"<<endl;}{
      |              ^~~~
a.cc:12:14: error: 'else' without a previous 'if'
   12 |              else if(s>=65) cout<<"B"<<endl;}{
      |              ^~~~
a.cc:13:14: error: 'else' without a previous 'if'
   13 |              else if(s>=50) cout<<"C"<<endl;}{
      |              ^~~~
a.cc:14:14: error: 'else' without a previous 'if'
   14 |              else if(s>=30 && r>=50) cout<<"C"<<endl;{
      |              ^~~~
a.cc:15:14: error: 'else' without a previous 'if'
   15 |              else if(s>=30 && r<50) cout <<"D"<<endl;}{
      |              ^~~~
a.cc:16:14: error: 'else' without a previous 'if'
   16 |              else if(s<30) cout<<"F"<<endl;}
      |              ^~~~
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int m,f,r,s;
        while(1){
             cin>>m>>f>>r;
             s=m+f;
             if(m==-1 && f==-1) break;{
             else 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 && r>=50) {cout<<"C"<<endl;}
             else if(s>=30 && r<50) {cout <<"D"<<endl;}
             else if(s<30) {cout<<"F"<<endl;}
         }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'else' without a previous 'if'
   10 |              else if(m==-1 || f==-1) {cout <<"F"<<endl;}
      |              ^~~~
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>

using namespace std;

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

char check(int m, int f, int r) {
	if(m < 0 || m < 0)
		return 'F';
	else if((m + f) >= 80)
		return 'A';
	else if((m + f) >= 65)
		return 'B';
	else if((m + f) >= 50)
		return 'C';
	else if((m + f) >= 30)
		if(r >= 50)
			return 'C';
		else
			return 'D';
	return 'F';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: expected ';' before 'if'
   11 |                         break
      |                              ^
      |                              ;
   12 |                 if(m < 0 || m < 0)
      |                 ~~