Language: C++

#include<iostream>
#include<string>
 
int main(){
    
  int string_length;
  int string_num;
  std::cin >> string_length >> string_num;
 
  std::vector<string> strings;
  
  int i;
  for(i=0; i < string_num; i++){
    string input;
    cin >> input;
    strings.push_back(input);
  }
  
  
  string result;
  
  while(strings.size > 0){
    string minimum;
    int minimum_pos;
    
	minimum = strings[0];
    minimum_pos = 0;
    
    for(i=0; i<strings.size; i++){
      if(strings[i].compare(minimum) < 0){
        minimum = strings[i];
        minimum_pos = i;
      }
    }
    result = result + minimum;
  	strings.erase(minimum_pos);
  }
  
  std::cout << result;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'vector' is not a member of 'std'
   10 |   std::vector<string> strings;
      |        ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | #include<string>
a.cc:10:15: error: 'string' was not declared in this scope
   10 |   std::vector<string> strings;
      |               ^~~~~~
a.cc:10:15: 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:10:23: error: 'strings' was not declared in this scope; did you mean 'stdin'?
   10 |   std::vector<string> strings;
      |                       ^~~~~~~
      |                       stdin
a.cc:14:11: error: expected ';' before 'input'
   14 |     string input;
      |           ^~~~~~
      |           ;
a.cc:15:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |     cin >> input;
      |     ^~~
      |     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:15:12: error: 'input' was not declared in this scope; did you mean 'int'?
   15 |     cin >> input;
      |            ^~~~~
      |            int
a.cc:20:9: error: expected ';' before 'result'
   20 |   string result;
      |         ^~~~~~~
      |         ;
a.cc:23:11: error: expected ';' before 'minimum'
   23 |     string minimum;
      |           ^~~~~~~~
      |           ;
a.cc:26:9: error: 'minimum' was not declared in this scope; did you mean 'minimum_pos'?
   26 |         minimum = strings[0];
      |         ^~~~~~~
      |         minimum_pos
a.cc:35:5: error: 'result' was not declared in this scope
   35 |     result = result + minimum;
      |     ^~~~~~
a.cc:39:16: error: 'result' was not declared in this scope
   39 |   std::cout << result;
      |                ^~~~~~