Language: C++

#include<iostream>
#include<string>
#include<vector>
 
int main(){
    
  int string_length;
  int string_num;
  std::cin >> string_length >> string_num;
 
  std::vector<std::string> strings;
  
  int i;
  for(i=0; i < string_num; i++){
    string input;
    std::cin >> input;
    strings.push_back(input);
  }
  
  std::string result;
  
  while(strings.size > 0){
    std::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:15:5: error: 'string' was not declared in this scope
   15 |     string input;
      |     ^~~~~~
a.cc:15:5: 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:16:17: error: 'input' was not declared in this scope; did you mean 'int'?
   16 |     std::cin >> input;
      |                 ^~~~~
      |                 int
a.cc:22:17: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]' (did you forget the '()' ?)
   22 |   while(strings.size > 0){
      |         ~~~~~~~~^~~~
      |                     ()
a.cc:29:24: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int]' (did you forget the '()' ?)
   29 |     for(i=0; i<strings.size; i++){
      |                ~~~~~~~~^~~~
      |                            ()
a.cc:36:22: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::erase(int&)'
   36 |         strings.erase(minimum_pos);
      |         ~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided