Skip to content

Commit fe79a14

Browse files
authored
112A
1 parent b95cf2d commit fe79a14

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Petya_and_Strings.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
int main()
4+
{
5+
long long i;
6+
string f,s;
7+
while(cin>>f>>s)
8+
{
9+
long sum1=0,sum2=0;
10+
for(i=0; i<f.size(); i++)
11+
{
12+
if(f[i]>='A'&&f[i]<='Z')
13+
f[i]=f[i]-'A'+97;
14+
if(s[i]>='A'&&s[i]<='Z')
15+
s[i]=s[i]-'A'+97;
16+
}
17+
for(i=0; i<s.size(); i++)
18+
{
19+
if(f[i]>s[i])
20+
{
21+
cout<<"1\n";
22+
return 0;}
23+
24+
if(s[i]>f[i])
25+
{
26+
cout<<"-1\n";
27+
return 0;
28+
}
29+
30+
}
31+
cout<<"0\n";
32+
}
33+
return 0;
34+
}

0 commit comments

Comments
 (0)