foo.cc:2:7: error: expected nested-name-specifier before 'namesrace'
using namesrace std;
^~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:6:5: error: 'cin' was not declared in this scope
cin>>L>>R;
^~~
foo.cc:6:5: note: suggested alternative:
In file included from foo.cc:1:
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/iostream:60:18: note: 'std::cin'
extern istream cin; /// Linked to standard input
^~~
foo.cc:7:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
for (int i=0;i<n;i++)
^
foo.cc:11:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
for (int i=0;i<n;i++)
^
foo.cc:13:14: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses]
if (L<=n[i]<=R)
~^~~~~~
foo.cc:18:5: error: 'cout' was not declared in this scope
cout <<sum;
^~~~
foo.cc:18:5: note: suggested alternative:
In file included from foo.cc:1:
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/iostream:61:18: note: 'std::cout'
extern ostream cout; /// Linked to standard output
^~~~