- #include<stdio.h>
- #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;
- }
Tuesday, January 21, 2020
Codeforces 112A Petya and Strings Solution in C
Subscribe to:
Post Comments (Atom)
Codeforces 131A cAPS lOCK Solution in C
#include <stdio.h> int main () { char ch [ 106 ]; int i , j , ck = 1 ; scanf ( "%s" , ch ); ...
-
#include <stdio.h> #include <string.h> int main () { int i , n , l = 0 ; char a [ 120 ]; scanf ( ...
-
#include <stdio.h> int main () { int o , n , a , b , c , s , t , u ; s = 0 ; t = 0 ; u = 0 ...
-
#include <stdio.h> #include <string.h> int main () { int i , n , p = 0 ; char s [ 120 ]; scanf ( ...
No comments:
Post a Comment