-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeforces_Petyaandstrings.cpp
More file actions
61 lines (40 loc) · 906 Bytes
/
Codeforces_Petyaandstrings.cpp
File metadata and controls
61 lines (40 loc) · 906 Bytes
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
52
53
54
55
56
57
58
59
60
61
#include<bits/stdc++.h>
using namespace std;
int main() {
string gift1, gift2;
cin >> gift1 >> gift2;
bool isEqual = false, isBigger = false, isSmaller = false;
int sz = gift1.size();
for(int i = 0; i < sz; i++) {
if(gift1[i] >= 'A' && gift1[i] <= 'Z') {
gift1[i] += 32;
}
if(gift2[i] >= 'A' && gift2[i] <= 'Z') {
gift2[i] += 32;
}
if(gift1[i] == gift2[i]) {
isEqual = true;
}
else if(gift1[i] > gift2[i]) {
isEqual = false;
isBigger = true;
break;
}
else {
isEqual = false;
isSmaller = true;
break;
}
}
if(isEqual) {
cout << "0";
}
else if(isBigger) {
cout << "1";
}
else {
cout << "-1";
}
cout << endl;
return 0;
}