Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int value (char number)
- {
- int v = tolower(number);
- if (v == 'a') return 1;
- if (v == 'b') return 2;
- if (v == 'c') return 3;
- if (v == 'd') return 4;
- if (v == 'e') return 5;
- if (v == 'f') return 6;
- if (v == 'g') return 7;
- if (v == 'h') return 8;
- if (v == 'i') return 9;
- if (v == 'j') return 10;
- if (v == 'k') return 11;
- if (v == 'l') return 12;
- if (v == 'm') return 13;
- if (v == 'n') return 14;
- if (v == 'o') return 15;
- if (v == 'p') return 16;
- if (v == 'q') return 17;
- if (v == 'r') return 18;
- if (v == 's') return 19;
- if (v == 't') return 20;
- if (v == 'u') return 21;
- if (v == 'v') return 22;
- if (v == 'w') return 23;
- if (v == 'x') return 24;
- if (v == 'y') return 25;
- if (v == 'z') return 26;
- }
- int main ()
- {
- char string1 [256];
- char string2 [256];
- scanf("%s", string1);
- scanf("%s", string2);
- int i , p1 = 0 , p2 = 0 , a , b ;
- int tam = strlen (string1);
- for (i = 0 ; i < tam ; i++)
- {
- a = value (string1[i]);
- b = value (string2[i]);
- if (a > b) p1++ ;
- if (a < b) p2++ ;
- }
- if (p1 == p2) printf("0\n");
- if (p1 > p2) printf("1\n");
- if (p1 < p2) printf("-1\n");
- return 0 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement