Language: C++

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

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


Compiler output:
a.cc:4:1: error: expected identifier before 'int'
    4 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | 
    4 | int main(){
      | ~~~             
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     cin >> m >> r;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:5: error: 'string' was not declared in this scope
    9 |     string ans;
      |     ^~~~~~
a.cc:9:5: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     if(m==-1 &&f==-1 )ans="F";
      |                       ^~~
      |                       abs
a.cc:11:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     else if (m+f >= 80) ans ="A";
      |                         ^~~
      |                         abs
a.cc:12:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |     else if (m+f >=65) ans ="B";
      |                        ^~~
      |                        abs
a.cc:13:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     else if (m+f >=50) ans ="C";
      |                        ^~~
      |                        abs
a.cc:15:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |           if(r>=50) ans ="C";
      |                     ^~~
      |                     abs
a.cc:16:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |           else ans = "D";
      |                ^~~
      |                abs
a.cc:18:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |      else ans ="F";
      |           ^~~
      |           abs
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout << ans << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |     cout << ans << endl;
      |             ^~~
      |             abs
a.cc:19:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |     cout << ans << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~