Language: C++

#include<iostream>
#include<string.h>
#include<algorithm>


using name space std;
bool fun(string a, string b){
  return a+b<b+a;
}
int main(){
  int n,l;
  cin>>n>>l;
  string a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n,fun);
  for(int i=0;i<n;i++){
    cout<<a[i];
  }
  return 0;
}


Compiler output:
a.cc:6:7: error: expected nested-name-specifier before 'name'
    6 | using name space std;
      |       ^~~~
a.cc:7:10: error: 'string' was not declared in this scope
    7 | bool fun(string a, string b){
      |          ^~~~~~
a.cc:7:10: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:20: error: 'string' was not declared in this scope
    7 | bool fun(string a, string b){
      |                    ^~~~~~
a.cc:7:20: note: suggested alternatives:
/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:7:28: error: expression list treated as compound expression in initializer [-fpermissive]
    7 | bool fun(string a, string b){
      |                            ^
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |   cin>>n>>l;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:3: error: 'string' was not declared in this scope
   13 |   string a[n];
      |   ^~~~~~
a.cc:13:3: note: suggested alternatives:
/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:15:10: error: 'a' was not declared in this scope
   15 |     cin>>a[i];
      |          ^
a.cc:17:8: error: 'a' was not declared in this scope
   17 |   sort(a,a+n,fun);
      |        ^
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   17 |   sort(a,a+n,fun);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout<<a[i];
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~