Language: C++

#include<iostream>
using namespace std;

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

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


Compiler output:
a.cc: In function 'char g(int, int, int)':
a.cc:5:9: error: declaration of 'int m' shadows a parameter
    5 |     int m,f,r;
      |         ^
a.cc:4:12: note: 'int m' previously declared here
    4 | char g(int m, int f, int r){
      |        ~~~~^
a.cc:5:11: error: declaration of 'int f' shadows a parameter
    5 |     int m,f,r;
      |           ^
a.cc:4:19: note: 'int f' previously declared here
    4 | char g(int m, int f, int r){
      |               ~~~~^
a.cc:5:13: error: declaration of 'int r' shadows a parameter
    5 |     int m,f,r;
      |             ^
a.cc:4:26: note: 'int r' previously declared here
    4 | char g(int m, int f, int r){
      |                      ~~~~^
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         g=='F'
      |         ~^~~~~
a.cc:8:15: error: expected ';' before '}' token
    8 |         g=='F'
      |               ^
      |               ;
    9 |     }else if(m+f<=80) {
      |     ~          
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         g=='A'
      |         ~^~~~~
a.cc:10:15: error: expected ';' before '}' token
   10 |         g=='A'
      |               ^
      |               ;
   11 |     }else if(65<=m+f&&m+f<80) {
      |     ~          
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         g=='B'
      |         ~^~~~~
a.cc:12:15: error: expected ';' before '}' token
   12 |         g=='B'
      |               ^
      |               ;
   13 |     }else if(50<=m+f&&m+f<65) {
      |     ~          
a.cc:14:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         g=='C'
      |         ~^~~~~
a.cc:14:15: error: expected ';' before '}' token
   14 |         g=='C'
      |               ^
      |               ;
   15 |     }else if(30<=m+f&&m+f<50&&50<=r) {
      |     ~          
a.cc:16:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         g=='C'
      |         ~^~~~~
a.cc:16:15: error: expected ';' before '}' token
   16 |         g=='C'
      |               ^
      |               ;
   17 |     }else if(30<=m+f&&m+f<50&&r<50) {
      |     ~          
a.cc:18:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |         g=='D'
      |         ~^~~~~
a.cc:18:15: error: expected ';' before '}' token
   18 |         g=='D'
      |               ^
      |               ;
   19 |     }else if(m+f<30) {
      |     ~          
a.cc:20:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |         g=='F'
      |         ~^~~~~
a.cc:20:15: error: expected ';' before '}' token
   20 |         g=='F'
      |               ^
      |               ;
   21 |     }
      |     ~          
a.cc:23:12: error: invalid conversion from 'char (*)(int, int, int)' to 'char' [-fpermissive]
   23 |     return g;
      |            ^
      |            |
      |            char (*)(int, int, int)