-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
70 lines (70 loc) · 954 Bytes
/
A.cpp
File metadata and controls
70 lines (70 loc) · 954 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
62
63
64
65
66
67
68
69
70
#include<string.h>
int main()
{
int x, i,o,l;
x=0;
char a[200],b[200];
scanf("%s %s",&a,&b);
l=strlen(a);
for (i=0;i<l;i++)
{
o=a[i]-b[i];
if (o!=0 && o!=32 && o!=-32)
{
if (a[i]<='z' && b[i]<='z' && a[i]>='a' && b[i]>='a')
{
if (a[i]>b[i])
{
x=1;
break;
}
else
{
x=-1;
break;
}
}
if (a[i]<='Z' && b[i]<='Z' && a[i]>='A' && b[i]>='A')
{
if (a[i]>b[i])
{
x=1;
break;
}
else
{
x=-1;
break;
}
}
if (a[i]<='Z' && a[i]>='A' && b[i]<='z' && b[i]>='a')
{
if (a[i]+32>b[i])
{
x=1;
break;
}
else
{
x=-1;
break;
}
}
if (a[i]<='z' && a[i]>='a' && b[i]<='Z' && b[i]>='A')
{
if (a[i]-32>b[i])
{
x=1;
break;
}
else
{
x=-1;
break;
}
}
}
}
printf("%d\n",x);
return 0;
}