Language: C++


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

int main()
{
	std::string s, t;

	std::getline(std::cin, s);
	std::getline(std::cin, t);

	for (int i = 0; i < s.length; i++)
	{
		for (int j = i + 1; j < s.length; j++)
		{
			char temp;
			if (s[i] > s[j])
			{
				temp = s[i];
				s[i] = s[j];
				s[j] = temp;
			}
		}
	}

	for (int i = 0; i < t.length; i++)
	{
		for (int j = i + 1; j < t.length; j++)
		{
			char temp;
			if (t[i] > t[j])
			{
				temp = t[i];
				t[i] = t[j];
				t[j] = temp;
			}
		}
	}

	for (int i = 0; i < std::min(s.length, t.length); i++)
	{
		if (s[i] >= t[i])
		{
			std::cout << "No";
			return 0;
		}
	}

	std::cout << "Yes";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   14 |         for (int i = 0; i < s.length; i++)
      |                             ~~^~~~~~
      |                                     ()
a.cc:16:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   16 |                 for (int j = i + 1; j < s.length; j++)
      |                                         ~~^~~~~~
      |                                                 ()
a.cc:28:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   28 |         for (int i = 0; i < t.length; i++)
      |                             ~~^~~~~~
      |                                     ()
a.cc:30:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   30 |                 for (int j = i + 1; j < t.length; j++)
      |                                         ~~^~~~~~
      |                                                 ()
a.cc:42:40: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
   42 |         for (int i = 0; i < std::min(s.length, t.length); i++)
      |                                      ~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/basic_string.h:1083:7: note: declared here
 1083 |       length() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~