-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path611-petya-and-strings.cpp
More file actions
40 lines (35 loc) · 919 Bytes
/
Copy path611-petya-and-strings.cpp
File metadata and controls
40 lines (35 loc) · 919 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
/*
* Petya and Strings [112A]
* Problem: https://codeforces.com/problemset/problem/112/A
* Verdict: ACCEPTED Solved: 2020-08-02
* Language: C++17 (GCC 7-32)
* Runtime: 62 ms Memory: 3700 KB
* Tags: implementation, strings
* Author: BidoTeima
* Source: https://codeforces.com/contest/112/submission/88763990
*/
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string string1;
string string2;
cin >> string1;
cin >> string2;
transform(string1.begin(), string1.end(), string1.begin(),
[](unsigned char c) { return tolower(c); });
transform(string2.begin(), string2.end(), string2.begin(),
[](unsigned char c) { return tolower(c); });
if (string1 == string2) { cout << 0; }
else if(lexicographical_compare(string1.begin(), string1.end(), string2.begin(), string2.end()))
{
cout << -1;
}
else
{
cout << 1;
}
return 0;
}