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'{
}

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:7:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |     if(m==-1||f==-1) g=='F'{
      |                      ~^~~~~
a.cc:7:28: error: expected ';' before '{' token
    7 |     if(m==-1||f==-1) g=='F'{
      |                            ^
      |                            ;
a.cc:8:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     }else if(m+f<=80) g=='A'{
      |                       ~^~~~~
a.cc:8:29: error: expected ';' before '{' token
    8 |     }else if(m+f<=80) g=='A'{
      |                             ^
      |                             ;
a.cc:9:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     }else if(65<=m+f&&m+f<80) g=='B'{
      |                               ~^~~~~
a.cc:9:37: error: expected ';' before '{' token
    9 |     }else if(65<=m+f&&m+f<80) g=='B'{
      |                                     ^
      |                                     ;
a.cc:10:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     }else if(50<=m+f&&m+f<65) g=='C'{
      |                               ~^~~~~
a.cc:10:37: error: expected ';' before '{' token
   10 |     }else if(50<=m+f&&m+f<65) g=='C'{
      |                                     ^
      |                                     ;
a.cc:11:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     }else if(30<=m+f&&m+f<50&&50<=r) g=='C'{
      |                                      ~^~~~~
a.cc:11:44: error: expected ';' before '{' token
   11 |     }else if(30<=m+f&&m+f<50&&50<=r) g=='C'{
      |                                            ^
      |                                            ;
a.cc:12:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     }else if(30<=m+f&&m+f<50&&r<50) g=='D'{
      |                                     ~^~~~~
a.cc:12:43: error: expected ';' before '{' token
   12 |     }else if(30<=m+f&&m+f<50&&r<50) g=='D'{
      |                                           ^
      |                                           ;
a.cc:13:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     }else if(m+f<30) g=='F'{
      |                      ~^~~~~
a.cc:13:28: error: expected ';' before '{' token
   13 |     }else if(m+f<30) g=='F'{
      |                            ^
      |                            ;
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:4:28: note: to match this '{'
    4 | char g(int m, int f, int r){
      |                            ^
a.cc:26:2: warning: no return statement in function returning non-void [-Wreturn-type]
   26 | }
      |  ^