foo.cc:2:16: error: expected identifier before ';' token
2 | using namespace;
| ^
foo.cc: In function 'int main()':
foo.cc:6:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>x;
| ^~~
| std::cin
In file included from foo.cc:1:
/usr/include/c++/9/iostream:60:18: note: 'std::cin' declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
foo.cc:7:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout<<"x1+x2=x"<<endl;
| ^~~~
| std::cout
In file included from foo.cc:1:
/usr/include/c++/9/iostream:61:18: note: 'std::cout' declared here
61 | extern ostream cout; /// Linked to standard output
| ^~~~
foo.cc:7:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | cout<<"x1+x2=x"<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/9/iostream:39,
from foo.cc:1:
/usr/include/c++/9/ostream:599:5: note: 'std::endl' declared here
599 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
foo.cc:5:11: warning: unused variable 'x1' [-Wunused-variable]
5 | int x,x1,x2;
| ^~
foo.cc:5:14: warning: unused variable 'x2' [-Wunused-variable]
5 | int x,x1,x2;
| ^~
[Hydro](https://hydro.ac)提供评测服务