112A Codeforces - Petya and strings


112A Codeforces - Petya and strings



Solution in c++

#include <bits/stdc++.h>

using namespace std;

string a,b;

int main()
{
    cin>>a>>b;
    for(int i=0;i<a.size();i++)
    {
        if(a[i]>='a' && a[i]<='z')a[i]-=32;
        if(b[i]>='a' && b[i]<='z')b[i]-=32;
    }
    if(a>b)cout<<1;
    else if(a<b)cout<<-1;
    else cout<<0;
    return 0;
}

Share on Google Plus

About Mohamed Sobhi

My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo
My hobbies is programming ,and web development ,playing chess and writing horror stories.
    Blogger Comment
    Facebook Comment

0 التعليقات:

إرسال تعليق