#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
char a[10010];
char b[10010];
int mycmp(char* s1, char* s2)
{
int re = 0;
int L1 = strlen(s1);
int L2 = strlen(s2);
int L = min(L1, L2);
for (int i = 0; i < L; i++)
{
if (tolower(s1[i]) == tolower(s2[i]))
{
if (s1[i] > s2[i])
{
re = 1;
break;
}
else if (s1[i] < s2[i])
{
re = -1;
break;
}
else
continue;
}
else
{
if (tolower(s1[i]) > tolower(s2[i]))
{
re = 1;
break;
}
else
{
re = -1;
break;
}
}
}
if (re == 0)
{
if (L1 == L2) re = 0;
else if (L1 < L2) re = -1;
else re = 1;
}
return re;
}
int main()
{
while (cin >> a >> b)
{
if (mycmp(a, b) == -1)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
文章评论