-
Notifications
You must be signed in to change notification settings - Fork 0
/
112A.Petya_and_Strings.cpp
51 lines (41 loc) · 1.03 KB
/
112A.Petya_and_Strings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <bits/stdc++.h>
using namespace std;
// Ashfak Hossain Evan, CSE, American International University-Bangladesh (AIUB)
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
// Code Start From Here
long long i;
string first, second;
while (cin >> first >> second)
{
long sum1(0), sum2(0);
for (size_t i = 0; i < first.size(); i++)
{
if (first[i] >= 'A' && first[i] <= 'Z')
{
first[i] = first[i] - 'A' + 97;
}
if (second[i] >= 'A' && second[i] <= 'Z')
{
second[i] = second[i] - 'A' + 97;
}
}
for (size_t i = 0; i < second.size(); i++)
{
if (first[i] > second[i])
{
cout << "1\n";
return 0;
}
if (second[i] > first[i])
{
cout << "-1\n";
return 0;
}
}
cout << "0\n";
}
return 0;
}