112A

Program

a,b,z=input().lower(),input().lower(),0
if a<b:z=-1
elif a>b:z=1
print(z)
#include <iostream>
#include <string>
 
using namespace std;
 
int main()
{
    int z = 0;
    string i1, i2;
    cin >> i1;
    cin >> i2;
    for (char &c : i1) c = toupper(c);
    for (char &c : i2) c = toupper(c);
    if (i1<i2){z-=1;}
    else if(i1>i2){z+=1;}
    else {z = 0;}
    cout << z << '\n';
return 0; 
}
z=0
x=list(input().lower())
y=list(input().lower())
 
if x == y: z=0
else:
    for e in x:
        index = x.index(e)
        if ord(x[index]) > ord(y[index]): z+=1;break
        elif ord(x[index]) < ord(y[index]): z-=1;break
print(z)

Comments

solution.cpp

  • A slightly different solution than the python version