Sunday, May 1, 2016

Codeforces 112A - Petya and Strings

#include<bits/stdc++.h>
#define i64 long long
#define mx(a,b,c) max(a,max(b,c))
#define mn(a,b,c) min(a,min(b,c))
#define eef else if
#define ff(i,s,e) for(int i=(s); i<e; i++)
#define ff2(i,s,e) for(int i=(s); i>=e; i--)
#define sf scanf
#define pf printf
#define dbug(x) cout<<"x = "<<x<<endl
#define newl cout<<"\n"
#define putcase cout<<"Case "<<++cse<<":"
#define putcase2 cout<<"Case #"<<++cse<<":"
using namespace std;
int main()
{
    string s;
    while(getline(cin,s)){
        transform(s.begin(),s.end(),s.begin(),::tolower);
        string t;
        getline(cin,t);
        transform(t.begin(),t.end(),t.begin(),::tolower);
        if(s==t)
            cout<<"0"<<endl;
        else if(s<t)
            cout<<"-1"<<endl;
        else if(s>t)
             cout<<"1"<<endl;
    }

    return 0;
}

No comments:

Post a Comment