text
stringlengths
49
983k
#include <bits/stdc++.h> using namespace std; int main() { string s, h; int i = 0; cin >> s >> h; for (i = 0; i < s.size(); i++) { s[i] = tolower(s[i]); } for (i = 0; i < h.size(); i++) { h[i] = tolower(h[i]); } if (s > h) cout << 1; else if (s < h) cout << -1; else cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s1, s2; cin >> s1 >> s2; transform(s1.begin(), s1.end(), s1.begin(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower); if (s1 == s2) cout << "0\n"; else if (s1 > s2) cout << "1\n"; else cout << "-1\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char a[110], b[110], c[110], d[110]; scanf("%s %s", a, b); for (int i = 0; i < strlen(a); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); } cout << strcmp(a, b) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { char str1[500], str2[500]; int i = 0; cin >> str1 >> str2; while (str1[i]) { str1[i] = tolower(str1[i]); str2[i] = tolower(str2[i]); i++; } cout << strcmp(str1, str2); return 0; }
#include <bits/stdc++.h> using namespace std; char toLower(char c) { if ((int)c <= 90) return (char)(c + 32); return c; } int main() { string a, b; cin >> a >> b; for (int i = 0; i < a.length(); i++) { if ((int)toLower(a[i]) > (int)toLower(b[i])) { cout << 1 << endl; break; } else if ((int)toLower(a[i]) < (int)toLower(b[i])) { cout << -1 << endl; break; } else if (i == a.length() - 1) cout << 0 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a; cin >> b; for (int i = 0; i < a.length(); i++) { if (a[i] >= 65 && a[i] <= 90) a[i] += 32; } for (int i = 0; i < b.length(); i++) { if (b[i] >= 65 && b[i] <= 90) b[i] += 32; } int flag = 0; for (int i = 0; i < a.length(); i++) { if (a[i] < b[i]) { flag = -1; break; } else if (b[i] < a[i]) { flag = 1; break; } else flag = 0; } cout << flag; return 0; }
#include <bits/stdc++.h> using namespace std; void lower(string &s) { transform(s.begin(), s.end(), s.begin(), ::tolower); } int main() { string s1, s2; cin >> s1 >> s2; lower(s1); lower(s2); for (int i = 0; i < s1.size(); i++) { if (s1[i] > s2[i]) { cout << 1 << endl; return 0; } else if (s1[i] < s2[i]) { cout << -1 << endl; return 0; } } cout << 0 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int cmp(char a, char b) { if (a > 90) { a = a - 32; } if (b > 90) { b = b - 32; } if (a < b) { return -1; } else if (a == b) { return 0; } else { return 1; } } int main_cmp(string s, string s1) { for (int i = 0; i < s.size(); i++) { if (cmp(s[i], s1[i]) == 1 || cmp(s[i], s1[i]) == -1) { return (cmp(s[i], s1[i])); } } return 0; } int main() { string s, s1; cin >> s; cin >> s1; cout << main_cmp(s, s1) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 2; const int INF = 1e9 + 7; int main() { string s1, s2; cin >> s1 >> s2; for (char &c : s1) { c = tolower(c); } for (char &c : s2) { c = tolower(c); } if (s1 == s2) { cout << 0; return 0; } if (s1 < s2) cout << -1; else cout << 1; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s, s1; cin >> s >> s1; for (int i = 0; i < s.size(); i++) { s[i] = towlower(s[i]); s1[i] = towlower(s1[i]); } if (s == s1) cout << "0"; else { for (int i = 0; i < s.size(); i++) { if (s[i] < s1[i]) { cout << "-1"; break; } if (s[i] > s1[i]) { cout << "1"; break; } } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int i, l, f = 0; ; char *s1 = (char *)malloc(101 * sizeof(char)); char *s2 = (char *)malloc(101 * sizeof(char)); scanf("%s", s1); scanf("%s", s2); l = strlen(s1); for (i = 0; i < l; i++) { if (s1[i] <= 'Z') { s1[i] = s1[i] - 'A' + 'a'; } if (s2[i] <= 'Z') { s2[i] = s2[i] - 'A' + 'a'; } if (s1[i] < s2[i]) { f = -1; break; } else if (s1[i] > s2[i]) { f = 1; break; } } printf("%d", f); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; while (cin >> a >> b) { for (int i = 0; i < a.length(); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); } if (a == b) cout << 0 << endl; else if (a > b) cout << 1 << endl; else cout << -1 << endl; } return 0; }
#include <bits/stdc++.h> int main() { char a[1000], b[1000]; scanf("%s", &a); scanf("%s", &b); printf("%d", strcasecmp(a, b)); return 0; }
#include <bits/stdc++.h> using namespace std; bool mycomp(char c1, char c2) { return tolower(c1) < tolower(c2); } int main() { char a[100], b[100]; cin >> a; cin >> b; for (int i = 0; i < strlen(a); i++) { a[i] = tolower(a[i]), b[i] = tolower(b[i]); } if (strcmp(a, b) == 0) cout << "0" << endl; else if (strcmp(a, b) < 0) cout << "-1" << endl; else cout << "1" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int gcd(int x, int y) { return x ? gcd(y % x, x) : y; } vector<int> groups; long long a, b; string s1, s2; string toLower(string s) { string result = ""; for (int i = 0; i < s.length(); i++) { if (s[i] < 97) result += (char)(s[i] + 32); else result += s[i]; } return result; } int main() { cin >> s1 >> s2; s1 = toLower(s1); s2 = toLower(s2); for (int i = 0; i < s1.length(); i++) { if (s1[i] < s2[i]) { cout << -1; return 0; } if (s1[i] > s2[i]) { cout << 1; return 0; } } cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int i; cin >> a >> b; for (i = 0; i < a.size(); i++) { if (a[i] < 91) { a[i] += 32; } if (b[i] < 91) { b[i] += 32; } } if (a > b) { cout << "1"; } else if (a < b) { cout << "-1"; } else { cout << "0"; } return 0; }
#include <bits/stdc++.h> char s[102], n[102]; int main() { scanf("%s", s); scanf("%s", n); int i, j, l; l = strlen(s); j = 0; int minus = 0, one = 0; for (i = 0; i < l; i++) { s[i] = tolower(s[i]); n[i] = tolower(n[i]); if (s[i] < n[i]) { minus = 1; break; } else if (s[i] == n[i]) { } else if (s[i] > n[i]) { one = 1; break; } } if (minus == 1) printf("-1\n"); else if (one == 1) printf("1\n"); else printf("0\n"); }
#include <bits/stdc++.h> using namespace std; int main() { string a; string b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { if (isupper(a[i])) a[i] = tolower(a[i]); } for (int i = 0; i < b.size(); i++) { if (isupper(b[i])) b[i] = tolower(b[i]); } if (a == b) { cout << "0"; } else if (a < b) { cout << "-1"; } else { cout << "1"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string st, ma; cin >> st >> ma; for (int i = 0; i < (int)st.size(); i++) st[i] = tolower(st[i]), ma[i] = tolower(ma[i]); int xx = (st < ma) * (-1) + (st == ma) * 0 + (st > ma) * 1; cout << xx << '\n'; }
#include <bits/stdc++.h> using namespace std; int main() { string s, p; int i; int a = 1, b = -1, c = 0; cin >> s; cin >> p; for (i = 0; i < s.size(); i++) { transform(s.begin(), s.end(), s.begin(), ::tolower); transform(p.begin(), p.end(), p.begin(), ::tolower); if (s[i] > p[i]) { cout << a << endl; break; } if (s[i] < p[i]) { cout << b << endl; break; } } if (s == p) cout << c << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1; cin >> s1; string s2; cin >> s2; for (int i = 0; i < s1.length(); i++) { s1[i] = tolower(s1[i]); } for (int i = 0; i < s2.length(); i++) { s2[i] = tolower(s2[i]); } int result = s1.compare(s2) == 0 ? 0 : s1.compare(s2) > 0 ? 1 : -1; cout << result; }
#include <bits/stdc++.h> using namespace std; string casing(string); int main() { string s1, s2; int count = 0, i; cin >> s1 >> s2; s1 = casing(s1); s2 = casing(s2); for (i = 0; i < s1.length(); i++) { if (s1[i] > s2[i]) { count = 1; break; } else if (s1[i] < s2[i]) { count = -1; break; } } cout << count << endl; return 0; } string casing(string s) { for (int i = 0; i < s.length(); i++) { if (s[i] == 'A') s[i] = 'a'; else if (s[i] == 'B') s[i] = 'b'; else if (s[i] == 'C') s[i] = 'c'; else if (s[i] == 'D') s[i] = 'd'; else if (s[i] == 'E') s[i] = 'e'; else if (s[i] == 'F') s[i] = 'f'; else if (s[i] == 'G') s[i] = 'g'; else if (s[i] == 'H') s[i] = 'h'; else if (s[i] == 'I') s[i] = 'i'; else if (s[i] == 'J') s[i] = 'j'; else if (s[i] == 'K') s[i] = 'k'; else if (s[i] == 'L') s[i] = 'l'; else if (s[i] == 'M') s[i] = 'm'; else if (s[i] == 'N') s[i] = 'n'; else if (s[i] == 'O') s[i] = 'o'; else if (s[i] == 'P') s[i] = 'p'; else if (s[i] == 'Q') s[i] = 'q'; else if (s[i] == 'R') s[i] = 'r'; else if (s[i] == 'S') s[i] = 's'; else if (s[i] == 'T') s[i] = 't'; else if (s[i] == 'U') s[i] = 'u'; else if (s[i] == 'V') s[i] = 'v'; else if (s[i] == 'W') s[i] = 'w'; else if (s[i] == 'X') s[i] = 'x'; else if (s[i] == 'Y') s[i] = 'y'; else if (s[i] == 'Z') s[i] = 'z'; } return (s); }
#include <bits/stdc++.h> using namespace std; string x, y; int main() { cin >> x >> y; for (int i = 0; i < x.size(); i++) { x[i] = (char)toupper(x[i]); y[i] = (char)toupper(y[i]); } if (x < y) { cout << -1 << endl; } else if (x == y) { cout << '0'; } else cout << '1'; }
#include <bits/stdc++.h> using namespace std; int main() { int i, length; char s1[110], s2[110]; scanf("%s", s1); scanf("%s", s2); length = strlen(s1); for (i = 0; i < length; i++) { if (s1[i] > 'Z') s1[i] = s1[i] - 32; if (s2[i] > 'Z') s2[i] = s2[i] - 32; } s1[i] = '\0'; s2[i] = '\0'; cout << strcmp(s1, s2); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); if (a.compare(b) == 0) cout << 0; if (a.compare(b) < 0) cout << -1; if (a.compare(b) > 0) cout << 1; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int first1, second1; first1 = second1 = 0; string a, b; getline(cin, a); getline(cin, b); for (int i = 0, j = 0; i < a.size(), j < b.size(); i++, j++) { char low = tolower(a[i]); char low1 = tolower(b[j]); if (low != low1) { int x = int(low); int y = int(low1); if (x < y) { second1++; break; } else { first1++; break; } } } if (first1 == 0 && second1 == 0) { cout << "0"; } else { if (first1 != 0) cout << "1"; else cout << "-1"; } return 0; }
#include <bits/stdc++.h> using namespace std; vector<long long> ans; long long temp; int main() { string a; string b; int flag = 0; cin >> a; cin >> b; for (int i = 0; i < (int)a.length(); ++i) { if (a[i] >= 97) a[i] = char(a[i] - 32); if (b[i] >= 97) b[i] = (char)(b[i] - 32); } for (int i = 0; i < (int)a.length(); ++i) { if (a[i] > b[i]) { cout << 1 << endl; return 0; } else if (a[i] < b[i]) { cout << -1 << endl; return 0; } } cout << 0 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s, s2; cin >> s >> s2; transform(s2.begin(), s2.end(), s2.begin(), ::tolower); transform(s.begin(), s.end(), s.begin(), ::tolower); cout << s.compare(s2); }
#include <bits/stdc++.h> using namespace std; int main() { string s, r; cin >> s; cin >> r; transform(s.begin(), s.end(), s.begin(), ::tolower); transform(r.begin(), r.end(), r.begin(), ::tolower); if (s == r) cout << "0"; else if (s < r) cout << "-1"; else if (s > r) cout << "1"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s, s1; cin >> s >> s1; transform(s.begin(), s.end(), s.begin(), ::tolower); transform(s1.begin(), s1.end(), s1.begin(), ::tolower); if (s > s1) cout << 1 << endl; else if (s < s1) cout << -1 << endl; else if (s == s1) cout << 0 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; string s2, s1; int t, n; int main() { cin >> s1 >> s2; for (int i = 0; i < s1.length(); i++) { if (s1[i] >= 'A' && s1[i] <= 'Z') s1[i] = char(s1[i] + 32); if (s2[i] >= 'A' && s2[i] <= 'Z') s2[i] = char(s2[i] + 32); if (s1[i] > s2[i]) { cout << 1; return 0; } else if (s1[i] < s2[i]) { cout << -1; return 0; } } cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int i, j, l; cin >> a >> b; l = a.size(); for (i = 0; i < l; i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); if (a.compare(b) < 0) { j = -1; } else if (a.compare(b) > 0) { j = 1; } else { j = 0; } } printf("%d\n", j); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char a[2][100]; cin >> a[0] >> a[1]; for (int i = 0; i < 2; i++) { for (int j = 0; j < 100; j++) { if (a[i][j] >= 65 && a[i][j] <= 90) a[i][j] = a[i][j] + 32; } } int l; l = strcmp(a[0], a[1]); cout << l; }
#include <bits/stdc++.h> using namespace std; int main() { string str1, str2; cin >> str1 >> str2; int l1, l2; l1 = str1.length(); for (int i = 0; i < l1; i++) { if (str1[i] >= 65 && str1[i] <= 90) str1[i] += 32; } for (int i = 0; i < l1; i++) { if (str2[i] >= 65 && str2[i] <= 90) str2[i] += 32; } if (str1 == str2) cout << "0" << endl; else if (str1 < str2) cout << "-1" << endl; else cout << "1" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i; string a, b; while (cin >> a >> b) { n = a.length(); for (i = 0; i < n; i++) { if (a[i] >= 'A' && a[i] <= 'Z') a[i] += 32; if (b[i] >= 'A' && b[i] <= 'Z') b[i] += 32; } if (a > b) cout << 1 << endl; else if (a < b) cout << -1 << endl; else cout << 0 << endl; } return 0; }
#include <bits/stdc++.h> FILE *in, *out; void dosya() { in = stdin; out = stdout; } int N; char a[105], b[105], c; void oku() { int i, tut1 = 0, tut2 = 0; while (1) { fscanf(in, "%c", &c); if (c == '\n') break; tolower(c); a[tut1] = tolower(c); ; a[tut1 + 1] = '\0'; tut1++; } while (1) { fscanf(in, "%c", &c); if (c == '\n') break; tolower(c); b[tut2] = tolower(c); ; b[tut2 + 1] = '\0'; tut2++; } int y = strcmp(a, b); fprintf(out, "%d", y); } int main() { dosya(); oku(); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string first, second; int n; int result = 0; cin >> first >> second; n = first.length(); for (int i = 0; i < n; i++) { first[i] = tolower(first[i]); second[i] = tolower(second[i]); } for (int i = 0; i < n; i++) { if (first[i] > second[i]) { result = 1; break; } else if (first[i] < second[i]) { result = -1; break; } } cout << result; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; transform(s1.begin(), s1.end(), s1.begin(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower); int counter = 0; for (int i = 0; i < s1.length(); i++) { if (int(s1[i]) > int(s2[i])) { cout << 1; counter = 1; break; } else if (int(s1[i]) < int(s2[i])) { cout << -1; counter = 1; break; } else { continue; } } if (counter == 0) { cout << 0; } return 0; }
#include <bits/stdc++.h> int main() { char str1[105], str2[105]; scanf("%s %s", str1, str2); for (int i = 0; i < strlen(str1); i++) { if (str1[i] >= 'a' && str1[i] <= 'z') str1[i] += 'A' - 'a'; if (str2[i] >= 'a' && str2[i] <= 'z') str2[i] += 'A' - 'a'; if (str1[i] > str2[i]) { printf("1"); return 0; } if (str2[i] > str1[i]) { printf("-1"); return 0; } } printf("0"); }
#include <bits/stdc++.h> using namespace std; void compareFunction(string s1, string s2) { int x = s1.compare(s2); if (x == 0) cout << 0 << endl; else if (x > 0) cout << 1 << endl; else cout << -1 << endl; } int main() { string s; string j; cin >> s >> j; transform(s.begin(), s.end(), s.begin(), ::tolower); transform(j.begin(), j.end(), j.begin(), ::tolower); compareFunction(s, j); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str1, str2; cin >> str1 >> str2; for (auto &c : str1) { c = tolower(c); } for (auto &c : str2) { c = tolower(c); } for (auto i = 0; i != str1.size(); ++i) { if (str1[i] < str2[i]) { cout << -1; return 0; } if (str1[i] > str2[i]) { cout << 1; return 0; } } cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); int n = a.compare(b); if (n < 0) { cout << -1 << '\n'; } else if (n == 0) { cout << 0 << '\n'; } else { cout << 1 << '\n'; } }
#include <bits/stdc++.h> using namespace std; int main() { string s, p; cin >> s >> p; for (int i = 0; i < s.size(); i++) { s[i] = tolower(s[i]); } for (int i = 0; i < p.size(); i++) { p[i] = tolower(p[i]); } if (s < p) { cout << -1 << endl; } if (s > p) { cout << 1 << endl; } if (s == p) { cout << 0 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char str1[105], str2[105]; cin >> str1; cin >> str2; int l1 = strlen(str1); int l2 = strlen(str2); for (int i = 0; i < l1; i++) { str1[i] = char(tolower(str1[i])); str2[i] = char(tolower(str2[i])); } if (strcmp(str1, str2) == 0) cout << "0" << endl; else { if (lexicographical_compare(str1, str1 + l1, str2, str2 + l2) == true) cout << "-1" << endl; else if (lexicographical_compare(str1, str1 + l1, str2, str2 + l2) == false) cout << "1" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; transform(s1.begin(), s1.end(), s1.begin(), ::toupper); transform(s2.begin(), s2.end(), s2.begin(), ::toupper); int compInt = s1.compare(s2); if (compInt < 0) cout << -1; if (compInt == 0) cout << 0; if (compInt > 0) cout << 1; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string arr1; string arr2; int cn1 = 0, cn2 = 0; cin >> arr1; cin >> arr2; transform(arr1.begin(), arr1.end(), arr1.begin(), ::tolower); transform(arr2.begin(), arr2.end(), arr2.begin(), ::tolower); for (int i = 0; i < arr1.length(); i++) { if (arr1[i] == arr2[i]) { cn1 = cn1 + int(arr1[i]); cn2 = cn2 + int(arr2[i]); } else { cn1 = cn1 + int(arr1[i]); cn2 = cn2 + int(arr2[i]); break; } } if (cn1 < cn2) cout << "-1"; else if (cn1 > cn2) cout << "1"; else cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s, a, s1, a1; cin >> s; cin >> a; for (int i = 0; i < s.size(); i++) { s1 += towlower(s[i]); a1 += towlower(a[i]); } if (s1 < a1) { cout << "-1"; } else if (s1 > a1) { cout << "1"; } else { cout << "0"; } }
#include <bits/stdc++.h> using namespace std; int main() { char a[150], b[150]; cin >> a; cin >> b; for (int i = 0; a[i]; i++) if (a[i] >= 'a' && a[i] <= 'z') a[i] = a[i] - 32; for (int i = 0; b[i]; i++) if (b[i] >= 'a' && b[i] <= 'z') b[i] = b[i] - 32; if (strcmp(a, b) == 0) cout << "0"; else if (strcmp(a, b) > 0) cout << "1"; else cout << "-1"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; int i, j, k, h, flag = 0; int l = a.size(); for (i = 0, j = 0; i < l, j < l; i++, j++) { if (a[i] == b[j]) { flag = 0; } else { a[i] = tolower(a[i]); b[j] = tolower(b[j]); if (a[i] == b[j]) { flag = 0; } else if (a[i] > b[j]) { flag = 1; break; } else { flag = -1; break; } } } cout << flag << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); if (a[i] != b[i]) { if (a[i] > b[i]) { cout << "1", exit(0); } else { cout << "-1", exit(0); } } } cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; transform(s1.begin(), s1.end(), s1.begin(), ::toupper); transform(s2.begin(), s2.end(), s2.begin(), ::toupper); int comp; comp = s1.compare(s2); cout << comp << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; getline(cin, s1); getline(cin, s2); int i; for (i = 0; i < s1.size(); i++) { if (s1[i] == s2[i] || (s1[i] == (char)((int)s2[i] + 32)) || (s1[i] == (char)((int)s2[i] - 32))) { continue; } else break; } if (i == s1.size()) cout << 0; else { if ((int)s1[i] < 97) s1[i] = (char)((int)s1[i] + 32); if ((int)s2[i] < 97) s2[i] = (char)((int)s2[i] + 32); if ((int)s1[i] > (int)s2[i]) cout << 1; else cout << -1; } return 0; }
#include <bits/stdc++.h> using namespace std; string s1, s2; int main() { cin >> s1 >> s2; for (int i = 0; i < s1.length(); i++) { if (s1[i] <= 'Z' && s1[i] >= 'A') { s1[i] += 32; } if (s2[i] <= 'Z' && s2[i] >= 'A') { s2[i] += 32; } } cout << s1.compare(s2) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { locale loc; string s, x; cin >> s >> x; string s1 = "", x1 = ""; for (int i = 0; i < s.length(); i++) { s1 += tolower(s[i], loc); x1 += tolower(x[i], loc); } if (s1 > x1) { printf("%d\n", 1); } else if (s1 < x1) { printf("%d\n", -1); } else { printf("%d\n", 0); } return 0; }
#include <bits/stdc++.h> using namespace std; int printASCII(char c) { int i = c; return i; } int main() { string len1; cin >> len1; string len2; cin >> len2; int equal_counter = 0; int len1_counter = 0; int len2_counter = 0; for (int i = 0; i < len1.length(); i++) { if (tolower(len1[i]) == tolower(len2[i])) { equal_counter++; } else { if (printASCII(tolower(len1[i])) > printASCII(tolower(len2[i]))) { cout << 1; return 0; } else if (printASCII(tolower(len1[i])) < printASCII(tolower(len2[i]))) { cout << -1; return 0; } } } if (equal_counter == len1.length()) { cout << 0; } return 0; }
#include <bits/stdc++.h> int main(int argc, char *argv[]) { char phy1[100], phy2[100]; int n, i; scanf("%s", &phy1); scanf("%s", &phy2); for (i = 0; i < strlen(phy1); i++) { if (isupper(phy1[i]) != 0) { phy1[i] += 32; } if (isupper(phy2[i]) != 0) { phy2[i] += 32; } } if (strcmp(phy1, phy2) == 0) { printf("0"); } else if (strcmp(phy1, phy2) > 0) { printf("1"); } else printf("-1"); }
#include <bits/stdc++.h> using namespace std; int main() { string first; string second; cin >> first; cin >> second; int len1 = first.length(); int len2 = second.length(); int a = 0; if (len1 == len2 && len1 >= 1 && len1 <= 100) { for (int i = 0; i < len1; i++) { } for (int i = 0; i < len1; i++) { tolower(first[i]); tolower(second[i]); if (tolower(first[i]) == tolower(second[i])) { a = 0; continue; } else if (tolower(first[i]) < tolower(second[i])) { a = -1; break; } else if (tolower(first[i]) > tolower(second[i])) { a = 1; break; } } cout << a; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int i, n; string s; cin >> s; string t; cin >> t; for (i = 0; s[i] != '\0'; i++) { if (s[i] >= 'A' && s[i] <= 'Z') s[i] = s[i] + 32; if (t[i] >= 'A' && t[i] <= 'Z') t[i] = t[i] + 32; } int found = 0; for (i = 0; s[i] != '\0'; i++) { if (s[i] > t[i]) { found = 1; break; } else if (t[i] > s[i]) { found = -1; break; } else { found = 0; } } cout << found; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) a[i] = toupper(a[i]); for (int i = 0; i < b.size(); i++) b[i] = toupper(b[i]); int r = a.compare(b); cout << r << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string word1, word2; int out; cin >> word1; cin >> word2; for (int i = 0; i < word1.length(); i++) { word1[i] = (tolower(word1[i])); word2[i] = (tolower(word2[i])); } if (word1 > word2) { out = 1; } else if (word1 < word2) { out = -1; } else { out = 0; } cout << out; return 0; }
#include <bits/stdc++.h> using namespace std; int flag = 0; int main() { char A[101], B[101]; int L; cin >> A >> B; L = strlen(A); for (int i = 0; i < L; i++) { A[i] = tolower(A[i]); B[i] = tolower(B[i]); if (A[i] < B[i]) { flag = -1; break; } else if (A[i] > B[i]) { flag = 1; break; } } cout << flag; getchar(); }
#include <bits/stdc++.h> int main() { int i; char str1[100], str2[100]; scanf("%s", str1); scanf("%s", str2); for (i = 0; str1[i] != '\0'; i++) { if (str1[i] >= 'A' && str1[i] <= 'Z') { str1[i] = str1[i] + 32; } } for (i = 0; str2[i] != '\0'; i++) { if (str2[i] >= 'A' && str2[i] <= 'Z') { str2[i] = str2[i] + 32; } } if (strcmp(str1, str2) < 0) { printf("-1"); } else if (strcmp(str1, str2) > 0) { printf("1"); } else { printf("0"); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2, s1_low, s2_low; cin >> s1 >> s2; for (int i = 0; i < s1.length(); i++) { s1_low += tolower(s1[i]); s2_low += tolower(s2[i]); } if (s1_low < s2_low) cout << -1 << endl; else if (s1_low == s2_low) cout << 0 << endl; else cout << 1 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int c1 = 0; int c2 = 0; int i = 0; for (; i < s1.length(); i++) { c1 += int(tolower(s1[i])); c2 += int(tolower(s2[i])); if (c1 == c2) continue; else if (c1 > c2) { cout << 1; break; } else { cout << -1; break; } } if (i == s1.length()) cout << 0; }
#include <bits/stdc++.h> using namespace std; string lower(string s) { string res = ""; for (int i = 0; i < s.length(); i++) res += tolower(s[i]); return res; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string a, b; getline(cin, a); a = lower(a); getline(cin, b); b = lower(b); if (a > b) cout << "1\n"; else if (a < b) cout << "-1\n"; else cout << "0\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char a[200], b[200]; gets(a); gets(b); int len = strlen(a); for (int j = 0; j < len; j++) { if (a[j] <= 'Z') a[j] = a[j] + 'a' - 'A'; if (b[j] <= 'Z') b[j] = b[j] + 'a' - 'A'; } int i = 0; for (; i < len; i++) if (a[i] != b[i]) break; if (a[i] == b[i]) cout << "0"; if (a[i] < b[i]) cout << "-1"; if (a[i] > b[i]) cout << "1"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { char x = tolower(a[i]), y = tolower(b[i]); if (x == y) continue; if (x < y) { cout << -1; return 0; } else { cout << 1; return 0; } } cout << 0; }
#include <bits/stdc++.h> using namespace std; int main() { string first; string second; cin >> first; cin >> second; int count1 = 0; if (first.size() == second.size()) { for (int i = 0; i < first.size(); i++) { if (first[i] < 97) { first[i] = first[i] + 32; } if (second[i] < 97) { second[i] = second[i] + 32; } if (first[i] == second[i]) { count1++; continue; } else { if (first[i] > second[i]) { cout << 1 << endl; break; } if (first[i] < second[i]) { cout << "-1" << endl; break; } } } if (count1 == first.size()) { cout << 0 << endl; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int cnt = 0, cnt1 = 0, cnt2 = 0; cin >> a >> b; transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); cnt = a.compare(b); if (cnt > 0) { cout << 1 << endl; } else if (cnt < 0) { cout << -1 << endl; } else { cout << 0 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str1; string str2; cin >> str1; cin >> str2; int counter = 0; int l = str1.length(); for (int i = 0; i < str1.size(); i++) { str1[i] = toupper(str1[i]); str2[i] = toupper(str2[i]); } if (str1 < str2) cout << "-1"; else if (str1 > str2) cout << "1"; else cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); string str1; string str2; cin >> str1 >> str2; transform(str1.begin(), str1.end(), str1.begin(), [](unsigned char c) { return tolower(c); }); transform(str2.begin(), str2.end(), str2.begin(), [](unsigned char c) { return tolower(c); }); if (str1 == str2) { cout << "0"; } else if (str1 > str2) { cout << "1"; } else { cout << "-1"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s[2]; for (int i = 0; i < 2; i++) { cin >> s[i]; } for (int i = 0; i < 2; i++) { transform(s[i].begin(), s[i].end(), s[i].begin(), ::tolower); } if (s[0] == s[1]) cout << "0"; else if (s[0] < s[1]) cout << "-1"; else cout << "1"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str1, str2; cin >> str1 >> str2; for (int i = 0; i < str1.size(); i++) { if (str1[i] >= 'A' && str1[i] <= 'Z') str1[i] += 32; if (str2[i] >= 'A' && str2[i] <= 'Z') str2[i] += 32; } for (int j = 0; j < str1.size(); j++) { if (str1[j] > str2[j]) { cout << "1"; return 0; } else if (str2[j] > str1[j]) { cout << "-1"; return 0; } } cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); if (a != b) if (a < b) cout << "-1"; else cout << "1"; else cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; for (int i = 0; i < a.length(); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); } if (a == b) cout << 0; else if (a > b) cout << 1; else cout << -1; }
#include <bits/stdc++.h> using namespace std; int main() { string str1, str2; cin >> str1 >> str2; int i; for (i = 0; i < str1.size(); i++) { char c1 = tolower(str1[i]); char c2 = tolower(str2[i]); if (c1 < c2) { cout << "-1"; break; } else if (c1 > c2) { cout << "1"; break; } } if (i == str1.size()) cout << "0"; }
#include <bits/stdc++.h> int main() { char s1[200], s2[200]; int a, i; scanf("%s%s", s1, s2); for (i = 0; s1[i] != '\0'; i++) { s1[i] = toupper(s1[i]); s2[i] = toupper(s2[i]); } a = strcmp(s1, s2); if (a == 0) printf("0"); else if (a == 1) printf("1"); else printf("-1"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char a[110], b[110]; cin >> a; cin >> b; for (int i = 0; a[i] != '\0'; i++) { if (a[i] >= 65 && a[i] <= 90) a[i] += 32; if (b[i] >= 65 && b[i] <= 90) b[i] += 32; } if (strcmp(a, b) == 0) cout << '0' << endl; if (strcmp(a, b) < 0) cout << "-1" << endl; if (strcmp(a, b) > 0) cout << '1' << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; for (int i = 0; i < a.length(); i++) { if (a[i] < 95) { a[i] += 32; } } for (int i = 0; i < a.length(); i++) { if (b[i] < 95) { b[i] += 32; } } int c = 0; for (int i = 0; i < a.length(); i++) { if (a[i] > b[i]) { cout << 1; c++; break; } else if (a[i] < b[i]) { cout << -1; c++; break; } } if (c == 0) { cout << 0; } return 0; }
#include <bits/stdc++.h> using ll = long long int; using vi = std::vector<int>; using ii = std::pair<int, int>; using vii = std::vector<ii>; const int N = 1010101; const int MD = 1e9 + 7; char a[N]; char b[N]; void read_input() { scanf("%s", (a)); ; scanf("%s", (b)); ; } void reset(); int ans = 0; void solve() { reset(); int len = (int)strlen(a); for (int i = 0; i < (len); ++i) a[i] = (char)tolower(a[i]); for (int i = 0; i < (len); ++i) b[i] = (char)tolower(b[i]); fprintf(stderr, "DBG: %s %s\n", "a", a); ; fprintf(stderr, "DBG: %s %s\n", "b", b); ; for (int i = 0; i < (len); ++i) { if (a[i] == b[i]) continue; if (a[i] < b[i]) ans = -1; else ans = 1; break; } } void reset() {} void print_ans() { printf("%d ", (ans)); ; } int main() { int t = 1; for (int tc = (1); tc < (t + 1); ++tc) { read_input(); solve(); print_ans(); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s, k; cin >> s; cin >> k; int flag = 0; for (int i = 0; i < s.length(); i++) { if (s[i] < 97) { s[i] = char(s[i] + 32); } if (k[i] < 97) { k[i] = char(k[i] + 32); } if (s[i] > k[i]) { cout << 1; flag = 1; break; } else if (s[i] < k[i]) { cout << -1; flag = 1; break; } } if (!flag) { cout << 0; } return 0; }
#include <bits/stdc++.h> using namespace std; string s, ss; int main() { cin >> s; cin >> ss; for (int i = 0; i <= s.size(); i++) { if (s[i] >= 'a') s[i] -= 'a' - 'A'; } for (int i = 0; i <= ss.size(); i++) { if (ss[i] >= 'a') ss[i] -= 'a' - 'A'; } if (s > ss) cout << 1; if (s == ss) cout << 0; if (s < ss) cout << -1; return 0; }
#include <bits/stdc++.h> int main() { char inp1[111], inp2[111]; scanf("%s %s", inp1, inp2); for (int i = 0; i < strlen(inp1); i++) { if (inp1[i] >= 'A' && inp1[i] <= 'Z') inp1[i] = inp1[i] - 'A' + 'a'; if (inp2[i] >= 'A' && inp2[i] <= 'Z') inp2[i] = inp2[i] - 'A' + 'a'; } if (strcmp(inp1, inp2) == 0) printf("0\n"); else if (strcmp(inp1, inp2) > 0) printf("1\n"); else if (strcmp(inp1, inp2) < 0) printf("-1\n"); return 0; }
#include <bits/stdc++.h> using namespace std; void fast() { std::ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { fast(); long long n, m, a = 0, b = 0; string s, ss; cin >> s >> ss; transform(s.begin(), s.end(), s.begin(), ::tolower); transform(ss.begin(), ss.end(), ss.begin(), ::tolower); if (s < ss) cout << "-1\n"; else if (s > ss) cout << "1\n"; else cout << "0\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; int c = 0, k = 0; for (int i = 0; i < a.size(); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); if (a[i] > b[i]) { c = 1; break; } else if (b[i] > a[i]) { c = -1; break; } } cout << c; return 0; }
#include <bits/stdc++.h> int main() { char a[110], b[110]; int sum, sum1 = 0, d; scanf("%s %s\n", a, b); for (d = 0;; d++) { if (a[d] == '\0') { break; } sum = a[d] - b[d]; if (a[d] > 64 && a[d] < 91 && b[d] > 96 && b[d] < 123 && sum != 32) { if (sum < -32) { sum1--; break; } if (sum > -32) { sum1++; break; } } else if (b[d] > 64 && b[d] < 91 && a[d] > 96 && a[d] < 123 && sum != -32) { if (sum < 32) { sum1--; break; } if (sum > 32) { sum1++; break; } } else if (sum < 26 && sum > 0) { sum1++; break; } else if (sum > -26 && sum < 0) { sum1--; break; } } printf("%d\n", sum1); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string a, b; cin >> a >> b; transform(a.begin(), a.end(), a.begin(), ::toupper); transform(b.begin(), b.end(), b.begin(), ::toupper); if (a.compare(b) < 0) cout << -1; else if (a.compare(b) > 0) cout << 1; else cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { string a, b; cin >> a >> b; int cnt = 0; for (int i = 0; i < a.length(); i++) { if (tolower(a[i]) > tolower(b[i])) { cout << 1; break; } else if (tolower(a[i]) < tolower(b[i])) { cout << -1; break; } else if (tolower(a[i]) == tolower(b[i])) { cnt++; } } if (cnt == a.length()) { cout << 0; } return 0; }
#include <bits/stdc++.h> using namespace std; string s, ss; int j; int main() { cin >> s; cin >> ss; for (j = 0; j < s.size(); j++) { if (s[j] >= 'a' && s[j] <= 'z') { s[j] -= 32; } if (ss[j] >= 'a' && ss[j] <= 'z') { ss[j] -= 32; } if (s[j] > ss[j]) { cout << "1"; return 0; } else if (s[j] < ss[j]) { cout << "-1"; return 0; } } cout << "0"; }
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long int; using ll = long long; using pii = pair<int, int>; using pll = pair<long long, long long>; ll gcd(ll a, ll b) { if (a == 0) return b; else return gcd(b % a, a); } ll bs(ll s, ll e, ll a[], ll v) { ll m = (s + e) / 2; if (v > a[m]) return bs(m + 1, e, a, v); else if (v < a[m]) return bs(s, m - 1, a, v); return m; } void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } void testingio() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); } int main() { fastio(); string s1, s2; cin >> s1 >> s2; int n = s1.length(); for (int i = 0; i < n; i += 1) { if (tolower(s1[i]) != tolower(s2[i])) { if (tolower(s1[i]) > tolower(s2[i])) cout << 1; else cout << -1; return 0; } } cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, i; string s1, s2; cin >> s1; cin >> s2; n = s1.length(); for (i = 0; i < n; i++) { s1[i] = tolower(s1[i]); s2[i] = tolower(s2[i]); } for (i = 0; i < n; i++) { if (s1[i] < s2[i]) { cout << -1; break; } else if (s1[i] > s2[i]) { cout << 1; break; } } if (i == n) cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int i, len, res; char s1[101], s2[101]; scanf("%s", s1); scanf("%s", s2); len = strlen(s1); for (i = 0; i < len; i++) { if ((s1[i] >= 65) && (s1[i] <= 90)) { s1[i] += 32; } if ((s2[i] >= 65) && (s2[i] <= 90)) { s2[i] += 32; } } res = 0; for (i = 0; i < len; i++) { if (s1[i] != s2[i]) { if (s1[i] > s2[i]) { res = 1; } else res = -1; break; } } printf("%d", res); return 0; }
#include <bits/stdc++.h> using namespace std; string a, b; int i; int main() { cin >> a >> b; for (i = 0; i < a.length(); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); if (a[i] != b[i]) { if (a[i] < b[i]) cout << "-1" << endl; else cout << "1" << endl; break; } } if (i == a.length()) cout << "0" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string x; string y; cin >> x; cin >> y; for (int i = 0; i < x.size(); i++) { x[i] = tolower(x[i]); y[i] = tolower(y[i]); } int r = x.compare(y); cout << r; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; getline(cin, s1); getline(cin, s2); for (int i = 0; i < s1.size(); i++) { if (s1[i] >= 65 && s1[i] <= 90) s1[i] += 32; } for (int i = 0; i < s2.size(); i++) { if (s2[i] >= 65 && s2[i] <= 90) s2[i] += 32; } if (s1 > s2) cout << 1; else if (s1 == s2) cout << 0; else cout << -1; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int m; m = 0; cin >> a; cin >> b; for (int i = 0; i < a.length(); i++) { if (isupper(a[i])) a[i] = tolower(a[i]); if (isupper(b[i])) b[i] = tolower(b[i]); if (a[i] - b[i] > 0) { m++; cout << m << endl; return 0; } else if (a[i] - b[i] < 0) { m--; cout << m << endl; return 0; } else continue; } cout << m << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string r, s, str, btr; int a, i, b; cin >> r >> s; b = s.size(); for (i = 0; i < b; i++) { if (r[i] >= 65 && r[i] <= 90) str = r[i] + 32; else str = r[i]; if (s[i] >= 65 && s[i] <= 90) btr = s[i] + 32; else btr = s[i]; if (str > btr) { cout << "1" << endl; break; } if (str < btr) { cout << "-1" << endl; break; } else { if (i == b - 1) cout << "0" << endl; else continue; } } }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; int flag = 0, f = 0; cin >> s1 >> s2; int l = s1.length(); for (int i = 0; i < l; i++) { if (s1[i] < 'a') { s1[i] += 32; } if (s2[i] < 'a') s2[i] += 32; if (s1[i] != s2[i]) { f = i; flag = 1; break; } } if (flag == 0) cout << "0"; else { if (s1[f] > s2[f]) cout << "1"; else cout << "-1"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; int ans = 0; cin >> s1 >> s2; int n = s1.size(); for (int i = 0; i < n; ++i) { if (s1[i] >= 'A' && s1[i] <= 'Z') s1[i] += 32; } for (int i = 0; i < n; ++i) { if (s2[i] >= 'A' && s2[i] <= 'Z') s2[i] += 32; } for (int i = 0; i < n; ++i) { if (s1[i] == s2[i]) continue; else if (s1[i] > s2[i]) { ans = 1; break; } else { ans = -1; break; } } cout << ans << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; void make_lower(char arr[]) { for (int i = 0; arr[i] != '\0'; i++) { arr[i] = tolower(arr[i]); } } int main() { int t, sum = 0, mx = 0; { char str1[123], str2[123]; scanf("%s %s", str1, str2); make_lower(str1); make_lower(str2); if (strcmp(str1, str2) == 0) cout << "0" << endl; else if (strcmp(str1, str2) < 1) cout << "-1" << endl; else if (strcmp(str1, str2) > 0) cout << "1" << endl; } }