#include <iostream>
#include <string>
#include <vector>
#include <cctype>
#include <algorithm>
int main()
{
std::vector<std::string> myvector
{
"HELLO", "Hello", "hello",
"hello", "HELLO", "Hello"
};
std::sort(std::begin(myvector), std::end(myvector), [](std::string const &a, std::string const &b)
{
return std::lexicographical_compare(std::begin(a), std::end(a), std::begin(b), std::end(b), [](std::string::value_type a, std::string::value_type b)
{
return std::tolower(a) < std::tolower(b);
});
});
for(auto const &s : myvector)
{
std::cout << s << std::endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y2N0eXBlPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKaW50IG1haW4oKQp7CglzdGQ6OnZlY3RvcjxzdGQ6OnN0cmluZz4gbXl2ZWN0b3IKCXsKCQkiSEVMTE8iLCAiSGVsbG8iLCAiaGVsbG8iLAoJCSJoZWxsbyIsICJIRUxMTyIsICJIZWxsbyIKCX07CglzdGQ6OnNvcnQoc3RkOjpiZWdpbihteXZlY3RvciksIHN0ZDo6ZW5kKG15dmVjdG9yKSwgW10oc3RkOjpzdHJpbmcgY29uc3QgJmEsIHN0ZDo6c3RyaW5nIGNvbnN0ICZiKQoJewoJICAgIHJldHVybiBzdGQ6OmxleGljb2dyYXBoaWNhbF9jb21wYXJlKHN0ZDo6YmVnaW4oYSksIHN0ZDo6ZW5kKGEpLCBzdGQ6OmJlZ2luKGIpLCBzdGQ6OmVuZChiKSwgW10oc3RkOjpzdHJpbmc6OnZhbHVlX3R5cGUgYSwgc3RkOjpzdHJpbmc6OnZhbHVlX3R5cGUgYikKCSAgICB7CgkgICAgICAgIHJldHVybiBzdGQ6OnRvbG93ZXIoYSkgPCBzdGQ6OnRvbG93ZXIoYik7CgkgICAgfSk7Cgl9KTsKCWZvcihhdXRvIGNvbnN0ICZzIDogbXl2ZWN0b3IpCgl7CgkJc3RkOjpjb3V0IDw8IHMgPDwgc3RkOjplbmRsOwoJfQp9Cg==