a779: Petya and Strings ( 彼佳與琴弦 )
Tags : 800 implementation strings
Accepted rate : 32人/33人 ( 97% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-07-25 08:42

Content

Little Petya loves presents. His mum bought him two strings of the same size for his birthday. The strings consist of uppercase and lowercase Latin letters. Now Petya wants to compare those two strings lexicographically. The letters' case does not matter, that is an uppercase letter is considered equivalent to the corresponding lowercase letter. Help Petya perform the comparison.

小彼佳喜歡禮物。 他的媽媽給他買了兩根同樣大小的琴弦作為生日禮物。 琴弦由大寫和小寫拉丁字母表示。 現在彼佳想要按字典順序比較這兩根琴弦。 字母的大小寫無關緊要,即一個大寫字母被認為等同於相應的小寫字母。 幫助彼佳進行比較。

Input

Each of the first two lines contains a bought string. The strings' lengths range from 1 to 100 inclusive. It is guaranteed that the strings are of the same length and also consist of uppercase and lowercase Latin letters.

前兩行中的每一行都包含一個購買的琴弦。 代表琴弦的字符串長度範圍從 1 到 100(含)。 保證字符串的長度相同,並且由大寫和小寫拉丁字母組成。

Output

If the first string is less than the second one, print "-1". If the second string is less than the first one, print "1". If the strings are equal, print "0". Note that the letters' case is not taken into consideration when the strings are compared.

如果第一個字符串小於第二個字符串,則打印“-1”。 如果第二個字符串小於第一個字符串,則打印“1”。 如果字符串相等,則打印“0”。 請注意,比較字符串時不考慮字母的大小寫。

Sample Input #1
aaaa
aaaA
Sample Output #1
0
Sample Input #2
abs
Abz
Sample Output #2
-1
Sample Input #3
abcdefg
AbCdEfF
Sample Output #3
1
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (5%): 0.5s , <1K
公開 測資點#1 (5%): 0.5s , <1K
公開 測資點#2 (5%): 0.5s , <1K
公開 測資點#3 (5%): 0.5s , <1K
公開 測資點#4 (5%): 0.5s , <1K
公開 測資點#5 (5%): 0.5s , <1K
公開 測資點#6 (5%): 0.5s , <1K
公開 測資點#7 (5%): 0.5s , <1K
公開 測資點#8 (5%): 0.5s , <1K
公開 測資點#9 (5%): 0.5s , <1K
公開 測資點#10 (5%): 0.5s , <1K
公開 測資點#11 (5%): 0.5s , <1K
公開 測資點#12 (5%): 0.5s , <1K
公開 測資點#13 (5%): 0.5s , <1K
公開 測資點#14 (6%): 0.5s , <1K
公開 測資點#15 (6%): 0.5s , <1K
公開 測資點#16 (6%): 0.5s , <1K
公開 測資點#17 (6%): 0.5s , <1K
公開 測資點#18 (6%): 0.5s , <1K
Hint :

If you want more formal information about the lexicographical order (also known as the "dictionary order" or "alphabetical order"), you can visit the following site:

如果您想了解更多關於字典順序(也稱為“字典順序”或“字母順序”)的正式信息,您可以訪問以下站點:

  • http://en.wikipedia.org/wiki/Lexicographical_order
Tags:
800 implementation strings
出處:
Codeforces Beta Round #85 [管理者:
lamkinun@gma... (Kinda Lam)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」