Main.cc:4:5: error: cannot declare ‘::main’ to be a global variable int main{ ^~~~ Main.cc:5:8: error: expected ‘}’ before ‘;’ token cin>>n; ^ Main.cc:5:5: error: invalid user-defined conversion from ‘std::basic_istream::__istream_type {aka std::basic_istream}’ to ‘int’ [-fpermissive] cin>>n; ~~~^~~ In file included from /usr/include/c++/7/ios:44:0, from /usr/include/c++/7/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from Main.cc:1: /usr/include/c++/7/bits/basic_ios.h:117:16: note: candidate is: std::basic_ios<_CharT, _Traits>::operator bool() const [with _CharT = char; _Traits = std::char_traits] explicit operator bool() const ^~~~~~~~ /usr/include/c++/7/bits/basic_ios.h:117:16: note: return type ‘bool’ of explicit conversion function cannot be converted to ‘int’ with a qualification conversion Main.cc:6:2: error: ‘n’ does not name a type n=d*=g/=2; ^ Main.cc:7:2: error: ‘cout’ does not name a type; did you mean ‘cosl’? cout<