Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Codeforces Round 112A
- #include <string>
- #include <cstring>
- #include <iostream>
- using namespace std;
- int main()
- {
- //variabless
- int len1, len2, answ=-2, tst1, tst2;
- string s1, s2;
- char mass1[101], mass2[101];
- //lowering letters
- cin >> s1 >> s2;
- len1 = s1.size();
- len2 = s2.size();
- strcpy(mass1, s1.c_str());
- strcpy(mass2, s2.c_str());
- for(int i=0;i<len1;i++) mass1[i] = (char)tolower(mass1[i]);
- for(int i=0;i<len2;i++) mass2[i] = (char)tolower(mass2[i]);
- //sorting
- for(int i=0;i<len1;i++)
- {
- if(mass1[i]!=mass2[i])
- {
- if(mass1[i]>mass2[i])
- {
- answ=1;
- break;
- }
- else
- {
- answ=-1;
- break;
- }
- }
- else if(i==len1-1)
- {
- answ=0;
- }
- }
- cout << answ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment