text
stringlengths
49
983k
#include <bits/stdc++.h> int main() { int walkvar, sizeofstr; char str[102], str2[102], c, d; str2[0] = str[0] = '\0'; fgets(str, 102, stdin); fgets(str2, 102, stdin); sizeofstr = strlen(str); str[sizeofstr - 1] = '\0'; str2[sizeofstr - 1] = '\0'; for (walkvar = 0; walkvar < sizeofstr; walkvar++) { c = str[walkvar]; d = str2[walkvar]; if (isupper(c)) { str[walkvar] = tolower(c); } if (isupper(d)) { str2[walkvar] = tolower(d); } } c = str[0]; d = str2[0]; for (walkvar = 0; walkvar < sizeofstr && c == d; walkvar++) { c = str[walkvar]; d = str2[walkvar]; } if (c == d) printf("0\n"); if (c > d) printf("1\n"); if (c < d) printf("-1\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { string a; string b; cin >> a >> b; for (int i = 0; i < a.length(); i++) { char x = tolower(a[i]); char y = tolower(b[i]); if (x > y) { cout << 1; return 0; } else if (y > x) { cout << -1; return 0; } } cout << 0; return 0; }
#include <bits/stdc++.h> int main() { char str[120], str1[120]; int i, l; gets(str); gets(str1); l = strlen(str); for (i = 0; i < l; i++) { str[i] = tolower(str[i]); str1[i] = tolower(str1[i]); } printf("%d\n", strcmp(str, str1)); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int m; string s, x; cin >> s >> x; for (int i = 0; i < s.length(); i++) { if (s[i] < 91) { s[i] = s[i] + 32; } } for (int i = 0; i < x.length(); i++) { if (x[i] < 91) { x[i] = x[i] + 32; } } for (int i = 0; i < s.length(); i++) { m = i; if (s[i] < x[i] || x[i] < s[i]) { break; } } if (s[m] < x[m]) cout << "-1"; if (x[m] < s[m]) cout << "1"; if (m = s.length() && x[m] == s[m]) cout << "0"; }
#include <bits/stdc++.h> using namespace std; int main() { char ch1[101], ch2[101]; int i, sum = 0, sum1 = 0, sum2 = 0; cin >> ch1 >> ch2; for (i = 0; i < strlen(ch1); i++) { if (ch1[i] >= 97 && ch1[i] <= 122) { ch1[i] -= 32; } if (ch2[i] >= 97 && ch2[i] <= 122) { ch2[i] -= 32; } if (ch1[i] > ch2[i]) { cout << "1" << endl; break; } else if (ch1[i] < ch2[i]) { cout << "-1" << endl; break; } } if (ch1[i] == ch2[i]) { cout << "0" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); string s, s2; cin >> s >> s2; for (int i = 0; i < s.size(); i++) s[i] = tolower(s[i]), s2[i] = tolower(s2[i]); if (s < s2) { cout << "-1\n"; } else if (s > s2) { cout << "1\n"; } else { cout << "0\n"; } 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++) { if (a[i] < 92) { a[i] += 32; } if (b[i] < 92) { b[i] += 32; } } if (a < b) { cout << "-1"; } else if (b < a) { cout << "1"; } else if (a == b) { 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(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower); if (s1 == s2) cout << "0"; else if (s1 > s2) cout << "1"; else cout << "-1"; }
#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 ans = 0; if (s1 == s2) ans = 0; else if (s1 < s2) ans = -1; else ans = 1; cout << ans << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int v = 0, c = 0, b = 0; string p, k; cin >> p; cin >> k; for (int j = 0; p[j] != '\0'; j++) { if (p[j] >= 'A' && p[j] <= 'Z') p[j] = p[j] + 32; if (k[j] >= 'A' && k[j] <= 'Z') k[j] = k[j] + 32; if (p[j] == k[j]) b++; else if (p[j] < k[j]) { cout << -1 << endl; break; } else if (p[j] > k[j]) { cout << 1 << endl; break; } } if (b == p.length()) cout << 0 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int cmp, l1, l2, c, cc, i; char s1[200], s2[200]; while (gets(s1) && gets(s2)) { c = 0; cc = 0; l1 = strlen(s1); l2 = strlen(s2); for (i = 0; i < l1; i++) { if (s1[i] >= 'a' && s1[i] <= 'z') { s1[i] = s1[i] - 32; } else if (s1[i] >= 'A' && s1[i] <= 'Z') { s1[i] = s1[i]; } } for (i = 0; i < l2; i++) { if (s2[i] >= 'a' && s2[i] <= 'z') { s2[i] = s2[i] - 32; } else if (s2[i] >= 'A' && s2[i] <= 'Z') { s2[i] = s2[i]; } } cmp = strcmp(s1, s2); cout << cmp << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string first, second; cin >> first; cin >> second; string up, up1; for (int i = 0; i <= first.size() - 1; i++) { up += tolower(first[i]); up1 += tolower(second[i]); } if (up == up1) { cout << "0" << endl; } else if (up > up1) { cout << "1" << endl; } else { cout << "-1" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char a[105], b[105]; int c, d; cin >> a >> b; d = strlen(a); for (int i = 0; i < d; i++) { if (a[i] >= 'A' && a[i] <= 'Z') { a[i] = a[i] - 'A' + 'a'; } if (b[i] >= 'A' && b[i] <= 'Z') { b[i] = b[i] - 'A' + 'a'; } if (a[i] != b[i]) { if (a[i] > b[i]) c = 1; else if (a[i] < b[i]) c = -1; break; } else c = 0; } cout << c << 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++) { int sum1 = 0; int sum2 = 0; if (a[i] > 'Z') sum1 += a[i] - 'a'; else sum1 += a[i] - 'A'; if (b[i] > 'Z') sum2 += b[i] - 'a'; else sum2 += b[i] - 'A'; if (sum1 < sum2) { cout << "-1" << endl; return 0; } else if (sum1 > sum2) { cout << "1" << endl; return 0; } } cout << "0" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char a[150], b[150]; int c, d, e, f, g, x, y, z; gets(a); gets(b); c = strlen(a); for (x = 0; x < c; x++) { if (a[x] >= 'A' && a[x] <= 'Z') a[x] = a[x] + ('a' - 'A'); if (b[x] >= 'A' && b[x] <= 'Z') b[x] = b[x] + ('a' - 'A'); } 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; void lowercase(string &str) { for (int i = int(0); i < int(str.length()); i++) { if ((int)str[i] < 97) str[i] = (char)(int)(str[i] + 32); } } bool isLexicoLess(string a, string b) { for (int i = int(0); i < int(a.length()); i++) { if ((int)a[i] > (int)b[i]) return false; else if ((int)a[i] < (int)b[i]) return true; } return true; } int main() { std::ios::sync_with_stdio(false); string a, b; cin >> a >> b; lowercase(a); lowercase(b); if (a == b) cout << 0 << endl; else { if (isLexicoLess(a, b)) cout << -1 << endl; else cout << 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int i, j; int len = s1.length(); int sum = 0, sum1 = 0; for (i = 0; i < len; i++) { if (s1[i] >= 'a' && s1[i] <= 'z') { s1[i] = s1[i] + 'A' - 'a'; } if (s2[i] >= 'a' && s2[i] <= 'z') { s2[i] = s2[i] + 'A' - 'a'; } } if (s1 > s2) cout << "1" << endl; else if (s1 < s2) cout << "-1" << endl; else cout << "0" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s1, s2; cin >> s1 >> s2; for_each(s1.begin(), s1.end(), [](char& c) { c = ::tolower(c); }); for_each(s2.begin(), s2.end(), [](char& c) { c = ::tolower(c); }); if (s1 == s2) { cout << 0; } else if (s1 < s2) { cout << -1; } else { cout << 1; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; int d = a.size(); transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); int count2 = 0, count3 = 0; for (int i = 0; i < d; i++) { count2 += (a[i] + '0') - (b[i] + '0'); if (count2 > 0) { cout << 1 << endl; break; } else if (count2 < 0) { cout << -1 << endl; break; } } if (count2 == 0) { cout << 0 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string s1; string s2; cin >> s1; cin >> s2; for (int i = 0; i < s1.size(); i++) { s1[i] = tolower(s1[i]); s2[i] = tolower(s2[i]); } if ((s1.compare(s2)) < 0) cout << "-1"; else if ((s1.compare(s2)) == 0) cout << "0"; else cout << "1"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char s1[110]; char s2[110]; int l1, l2; int i; scanf("%s%s", s1, s2); l1 = strlen(s1); l2 = strlen(s2); for (i = 0; i < l1; i++) { if (s1[i] >= 'A' && s1[i] <= 'Z') s1[i] = s1[i] + 32; } for (i = 0; i < l2; i++) { if (s2[i] >= 'A' && s2[i] <= 'Z') s2[i] = s2[i] + 32; } int m = strcmp(s1, s2); printf("%d", m); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; vector<char> a(str.begin(), str.end()); cin >> str; vector<char> b(str.begin(), str.end()); int res = 0; for (int i = 0; i < a.size(); i++) { if (a[i] >= 'a') a[i] += -'a' + 'A'; if (b[i] >= 'a') b[i] += -'a' + 'A'; if (a[i] > b[i]) { res = 1; break; } else if (a[i] < b[i]) { res = -1; break; } } printf("%d\n", res); }
#include <bits/stdc++.h> using namespace std; using namespace std; int main() { char str1[200], str2[200]; while (gets(str1)) { gets(str2); for (int i = 0; str1[i] != '\0'; i++) { str1[i] = tolower(str1[i]); } for (int i = 0; str2[i] != '\0'; i++) { str2[i] = tolower(str2[i]); } int ans = strcmp(str1, str2); if (ans < 0) ans = -1; else if (ans > 0) ans = 1; printf("%d\n", ans); } return 0; }
#include <bits/stdc++.h> long long compute_mod(long long a, long long b) { assert(b > 0); long long rem = a % b; return rem < 0 ? b + rem : rem; } long long compute_total_divisors(long long n) { long long total_divisors = 0; for (long long i = 1; i <= (n / i); ++i) { if (!(n % i)) { if ((n / i) == i) { ++total_divisors; continue; } total_divisors += 2; } } return total_divisors; } bool check_perfect_sequare(long long n) { return compute_total_divisors(n) % 2 ? true : false; } int main(void) { std ::ios ::sync_with_stdio(0); std ::cin.tie(NULL); std ::cout.tie(NULL); std ::string string1, string2; std ::cin >> string1 >> string2; std ::transform(string1.begin(), string1.end(), string1.begin(), [](char c) { return std ::tolower(c); }); std ::transform(string2.begin(), string2.end(), string2.begin(), [](char c) { return std ::tolower(c); }); int ret_value = string1.compare(string2); std ::cout << (ret_value < 0 ? -1 : ret_value > 0 ? 1 : 0) << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; string string1, string2; int counter = 0; int main() { cin >> string1 >> string2; for (int i = 0; i < string1.size(); i++) { if (int(tolower(string1[i])) > int(tolower(string2[i]))) { cout << 1 << endl; break; } else if (int(tolower(string1[i])) < int(tolower(string2[i]))) { cout << -1 << endl; break; } else counter++; } if (counter == string2.size()) cout << 0 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; string s2, s1; int a; char b; int main() { ifstream in; in.open("a.txt"); cin >> s1 >> s2; for (int i = 0; i < s1.length(); i++) { if (s1[i] <= 'Z') s1[i] = s1[i] + 32; if (s2[i] <= 'Z') s2[i] = s2[i] + 32; } for (long long int i = 0; i < s1.length(); i++) { if (s1[i] > s2[i]) { cout << "1"; exit(0); } if (s1[i] < s2[i]) { cout << "-1"; exit(0); } } cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; bool isUpper(string s) { return std::all_of(s.begin(), s.end(), [](unsigned char c) { return std::isupper(c); }); } 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 ans = 0; for (int i = 0; i < s1.length(); i++) { if (s1[i] > s2[i]) { ans = 1; break; } else if (s1[i] < s2[i]) { ans = -1; break; } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> int main() { int m, n, i, j, t, l1, l2, result; char a[110], b[110]; gets(a); gets(b); l1 = strlen(a); l2 = strlen(b); for (i = 0; i < l1; i++) { if (a[i] >= 'a' && a[i] <= 'z') { a[i] = a[i] - 32; } } for (i = 0; i < l2; i++) { if (b[i] >= 'a' && b[i] <= 'z') { b[i] = b[i] - 32; } } result = strcmp(a, b); printf("%d", result); }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; for (auto &i : b) { if (i >= 65 && i <= 90) i = i + 32; } for (auto &i : a) { if (i >= 65 && i <= 90) i = i + 32; } int n = a.length(); int ans = 0; for (int i = 0; i < n; ++i) { if (a[i] != b[i]) { ans = a[i] < b[i] ? -1 : 1; break; } } cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); string b, a; cin >> a >> b; for (int i = (0); i < (a.size()); ++i) { if (tolower(a[i]) == tolower(b[i])) continue; if (tolower(a[i]) < tolower(b[i])) { printf("-1\n"); return 0; } else { printf("1\n"); return 0; } } printf("0\n"); 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]); } for (int j = 0; j < b.size(); j++) { b[j] = tolower(b[j]); } if (a > b) { cout << "1" << endl; } else if (a < b) { cout << "-1" << endl; } else cout << "0" << endl; 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) { cout << "-1" << endl; } if (a > b) { cout << "1" << endl; } if (a == b) { cout << "0" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string word1, word2; cin >> word1 >> word2; for (int i = 0; i < word1.size(); i++) { if (word1.at(i) >= 65 && word1.at(i) <= 90) { word1.at(i) += 32; } if (word2.at(i) >= 65 && word2.at(i) <= 90) { word2.at(i) += 32; } } if (word1 > word2) { cout << "1"; } else if (word1 < word2) { cout << "-1"; } else if (word1 == word2) { cout << "0"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1; cin >> s2; for (int i = 0; i < s1.length(); i++) { s1[i] = toupper(s1[i]); s2[i] = toupper(s2[i]); } if (s1.compare(s2) > 0) cout << "1"; if (s1.compare(s2) == 0) cout << "0"; if (s1.compare(s2) < 0) cout << "-1"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1; cin >> s2; int i, j; for (i = 0; i < s1.length(); i++) { s1[i] = tolower(s1[i]); } for (j = 0; j < s2.length(); j++) { s2[j] = tolower(s2[j]); } 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 str1, str2; cin >> str1 >> str2; for (int x = 0; x < str1.length(); x++) { str1[x] = toupper(str1[x]); str2[x] = toupper(str2[x]); } for (int x = 0; x < str2.length(); x++) { if (str1[x] == str2[x]) continue; else { if ((int)str1[x] > (int)str2[x]) cout << "1" << endl; else if ((int)str1[x] < (int)str2[x]) cout << "-1" << endl; return 0; } } cout << "0" << endl; 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) cout << 1; if (a < b) cout << -1; if (a == b) cout << 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2, s3, s4; int n, i; cin >> s1 >> s2; n = s1.length(); for (i = 0; i < n; i++) { s3 += toupper(s1[i]); s4 += toupper(s2[i]); } if (s3 == s4) cout << "0"; else if (s3 > s4) cout << "1"; else cout << "-1"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; for (int i = 0; i < s1.length(); i++) { s1[i] = tolower(s1[i]); s2[i] = tolower(s2[i]); } bool islex = false; for (int i = 0; i < s1.length(); i++) { int d1, d2; d1 = int(s1[i]); d2 = int(s2[i]); if (d1 - d2 == 0) { islex = true; continue; } else if (d1 - d2 > 0) { islex = false; cout << "1" << "\n"; break; } else if (d1 - d2 < 0) { islex = false; cout << "-1" << "\n"; break; } } if (islex) { cout << "0" << "\n"; } }
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; string s1, second; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> s1 >> second; for (int i = 0; i < s1.length(); i++) { if (s1[i] >= 97) s1[i] -= 32; if (second[i] >= 97) second[i] -= 32; if (s1[i] < second[i]) { cout << -1 << '\n'; return 0; } else if (second[i] < s1[i]) { cout << 1 << '\n'; return 0; } } cout << 0 << '\n'; return 0; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string str, s; cin >> str >> s; for (int i = 0; i < str.size(); ++i) { if (str[i] < 97) str[i] += 32; if (s[i] < 97) s[i] += 32; } if (str > s) cout << 1; else if (str < s) cout << -1; else cout << 0; }
#include <bits/stdc++.h> using namespace std; string a, b; int main() { cin >> a >> b; for (int i = 0; i < a.size(); i++) { if (a[i] < 92) { a[i] += 32; } if (b[i] < 92) { b[i] += 32; } } if (a < b) { cout << -1; } else if (a > b) { cout << 1; } else if (a == b) { cout << 0; } }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; for (int i = 0; i < s1.size(); i++) { if (s1[i] >= 'A' && s1[i] <= 'Z') { s1[i] += 32; } } for (int i = 0; i < s2.size(); i++) { if (s2[i] >= 'A' && s2[i] <= 'Z') { 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() { long long int t, i, j; string s1, s2; cin >> s1 >> s2; long long int ans = 0; for (i = 0; i < s1.length(); i++) { s1[i] = tolower(s1[i]); s2[i] = tolower(s2[i]); if (s1[i] < s2[i]) { ans = -1; break; } else if (s1[i] > s2[i]) { ans = 1; break; } } cout << ans << '\n'; }
#include <bits/stdc++.h> int main() { int i, x, y = 0; char a[101], b[101]; gets(a); gets(b); x = strlen(a); for (i = 0; i < x; i++) { if (tolower(a[i]) > tolower(b[i])) { y = 1; printf("1"); return 0; } if (tolower(a[i]) < tolower(b[i])) { y = 1; printf("-1"); return 0; } } printf("0"); }
#include <bits/stdc++.h> using namespace std; long long mod = 1000000007; long long n, m, k, i, j, s, g, h, p, l = 0; int main() { string a, b; cin >> a >> b; transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); for (i = 0; i < a.length(); i++) if (a[i] < b[i]) { cout << -1; return 0; } else { if (a[i] > b[i]) { cout << 1; return 0; } } cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; string s, m; int main() { cin >> s >> m; for (int i = 0; i < s.size(); i++) { if ((int)(s[i]) <= 90) s[i] = s[i] + 32; } for (int i = 0; i < m.size(); i++) { if ((int)(m[i]) <= 90) m[i] = m[i] + 32; } if (s == m) cout << 0; if (s > m) cout << 1; if (s < m) cout << -1; }
#include <bits/stdc++.h> using namespace std; int main() { char str1[105], str2[105]; cin >> str1 >> str2; for (int i = 0; i < strlen(str1); i++) { if (str1[i] <= 'Z' && str1[i] >= 'A') str1[i] = tolower(str1[i]); } for (int i = 0; i < strlen(str2); i++) { if (str2[i] <= 'Z' && str2[i] >= 'A') str2[i] = tolower(str2[i]); } for (int i = 0; i < strlen(str1); i++) { int k = int(str1[i] - str2[i]); if (k < 0) { cout << "-1" << endl; return 0; } else if (k > 0) { cout << "1" << endl; return 0; } } cout << "0" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1; cin >> s2; transform(s1.begin(), s1.end(), s1.begin(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower); if (s1 > s2) { cout << "1" << endl; } else if (s1 < s2) { cout << "-1" << endl; } if (s1 == s2) { cout << "0" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; string n, m; int main() { cin >> n >> m; for (int i = 0; i < n.size(); i++) { if (n[i] < 92) { n[i] += 32; } if (m[i] < 92) { m[i] += 32; } } if (n < m) { cout << -1; } else if (n > m) { cout << 1; } else if (n == m) { cout << 0; } }
#include <bits/stdc++.h> using namespace std; string c1, c2; int main() { int x; cin >> c1 >> c2; for (int i = 0; i < c1.size(); i++) { if (c1[i] < 92) { c1[i] += 32; } if (c2[i] < 92) { c2[i] += 32; } } printf("%d\n", c1.compare(c2)); return 0; }
#include <bits/stdc++.h> int main(void) { char word1[101]; char word2[101]; int sum1 = 0, sum2 = 0; scanf("%s", word1); scanf("%s", word2); int n = strlen(word1); for (int i = 0; i < n; i++) { if (tolower(word1[i]) > tolower(word2[i])) { printf("1\n"); return 0; } if (tolower(word1[i]) < tolower(word2[i])) { printf("-1\n"); return 0; } } printf("0\n"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; for (int i = 0; i < s1.size(); i++) { s1[i] = tolower(s1[i]); s2[i] = tolower(s2[i]); } if (s1 < s2) { cout << -1; } else if (s2 < s1) { cout << 1; } else { cout << 0; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string p, z; cin >> p; cin >> z; for (int i = 0; i < p.length(); i++) { if (p[i] >= 'A' && p[i] <= 'Z') p[i] = tolower(p[i]); } for (int i = 0; i < z.length(); i++) { if (z[i] >= 'A' && z[i] <= 'Z') z[i] = tolower(z[i]); } cout << p.compare(z); return 0; }
#include <bits/stdc++.h> using namespace std; int solve(string a, string b) { int count = 0; for (int i = 0; i < a.size(); i++) { if (tolower(b[i]) > tolower(a[i])) return -1; else if (tolower(a[i]) > tolower(b[i])) return 1; else count++; } if (a.size() == count) { return 0; } } int main() { string a, b; cin >> a >> b; cout << solve(a, b); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; int i; transform(s1.begin(), s1.end(), s1.begin(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower); for (i = 0; i < s1.size(); i++) { if (s1[i] > s2[i]) { cout << 1 << endl; break; } if (s1[i] < s2[i]) { cout << -1 << endl; break; } } if (i == s1.size()) { cout << 0 << endl; } return 0; }
#include <bits/stdc++.h> int main() { char a[100], b[100]; int i, n, m, temp = 0; scanf("%s", a); scanf("%s", b); n = strlen(a); m = strlen(b); for (i = 0; i < n; i++) { if (a[i] < 96) a[i] = a[i] + 32; } for (i = 0; i < m; i++) { if (b[i] < 96) b[i] = b[i] + 32; } temp = strcmp(a, b); printf("%d\n", temp); }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> 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]); } if (s1 > s2) { cout << "1" << endl; } else if (s1 < s2) { cout << "-1" << endl; } else { cout << "0" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int len, i, p, c, d, sum; string a; string b; cin >> a; cin >> b; sum = 0; len = a.size(); for (i = 0; i < len; i++) { p = abs(a[i] - b[i]); if (p == 32 || p == 0) { sum = sum + 1; } else if (p != 32 && p != 0) { if (isupper(a[i])) { c = a[i]; } else { c = a[i] - 32; } if (isupper(b[i])) { d = b[i]; break; } else { d = b[i] - 32; break; } } } if (sum == len) { cout << "0"; } else if (c > d) { cout << "1"; } else if (d > c) { cout << "-1"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1; cin >> s2; transform(s1.begin(), s1.end(), s1.begin(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower); cout << s1.compare(s2); }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { int p = a[i], q = b[i]; if (abs(p - q) == 32) continue; if (p >= 97) p -= 32; if (q >= 97) q -= 32; if (p > q) { cout << 1 << endl; return 0; } else if (q > p) { cout << -1 << endl; return 0; } } cout << 0 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; for (int i = 0; i < s1.length(); i++) { if (s1[i] < 97) s1[i] += 32; if (s2[i] < 97) s2[i] += 32; } if (s1 < s2) cout << "-1" << endl; else if (s1 > s2) cout << "1" << endl; else cout << "0" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { char s[105], t[105]; gets(s); gets(t); for (int i = 0; i < strlen(s); ++i) { if (s[i] >= 'A' && s[i] <= 'Z') { s[i] = (s[i] - 'A' + 'a'); } } for (int i = 0; i < strlen(t); ++i) { if (t[i] >= 'A' && t[i] <= 'Z') { t[i] = (t[i] - 'A' + 'a'); } } int v = strcmp(s, t); printf("%d\n", v); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; char x[100], y[100]; cin >> x >> y; a = x; b = y; for (int c = 0; c < a.size(); c++) { if (x[c] > 96) { x[c] -= 32; } if (y[c] > 96) { y[c] -= 32; } } a = x; b = y; if (a > b) { cout << "1"; } if (a == b) { cout << "0"; } if (a < b) { cout << "-1"; } return 0; }
#include <bits/stdc++.h> int main(void) { char x[102], y[102]; scanf("%s", x); scanf("%s", y); int q = strlen(x), dif = 0, c; for (int i = 0; i < q; i++) { x[i] = tolower(x[i]); y[i] = tolower(y[i]); } c = strcmp(x, y); if (c > 0) puts("1"); c = strcmp(x, y); if (c < 0) puts("-1"); c = strcmp(x, y); if (c == 0) puts("0"); return 0; }
#include <bits/stdc++.h> using namespace std; using namespace std; void solve() { long long m, n, i, a, j, p, q, ans = 0, l, r, ans2; string s1, s2; cin >> s1 >> s2; for (long long i = 0; i < s1.size(); i++) { if (s1[i] - s2[i] != 0 && abs(s1[i] - s2[i]) != 'a' - 'A') { if (s1[i] >= 97) p = s1[i] - 97; else p = s1[i] - 65; if (s2[i] >= 97) q = s2[i] - 97; else q = s2[i] - 65; if (p > q) { cout << 1; return; } else { cout << -1; return; } } } cout << 0; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long t; t = 1; while (t--) solve(); return 0; }
#include <bits/stdc++.h> using namespace std; void process() { string a, b; cin >> a >> b; for (int i = 0; i < a.size(); 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; if (a > b) cout << 1 << endl; if (a == b) cout << 0 << endl; return; } int main() { process(); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a; string b; int i; cin >> a >> b; for (i = 0; i < a.size(); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); } if (a == b) cout << "0" << endl; else { for (i = 0; i < a.size(); i++) { if (a[i] < b[i]) { cout << "-1" << endl; break; } if (a[i] > b[i]) { cout << "1" << endl; break; } } } return 0; }
#include <bits/stdc++.h> using namespace std; const int maxn = 110; int ar[maxn]; void solve() { string a, b; cin >> a >> b; int n = a.length(); int res = 0; for (int i = 0; i < n; i++) { if (a[i] >= 'A' && a[i] <= 'Z') { a[i] = char('a' + (a[i] - 'A')); } if (b[i] >= 'A' && b[i] <= 'Z') { b[i] = char('a' + (b[i] - 'A')); } if (a[i] < b[i]) { res = -1; break; } if (a[i] > b[i]) { res = 1; break; } } cout << res; } int main() { ios::sync_with_stdio(0); cin.tie(0); solve(); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int tam, cont, cont1 = 0, i, num, cont2 = 0; string V, V1; cin >> V >> V1; tam = V.size(); for (i = 0; i < tam; i++) { if (V[i] >= 'A' && V[i] <= 'Z') { V[i] = V[i] + 32; } if (V1[i] >= 'A' && V1[i] <= 'Z') { V1[i] = V1[i] + 32; } } cont = V.compare(V1); if (cont == 0) { cout << 0 << "\n"; } if (cont > 0) { cout << 1 << "\n"; } if (cont < 0) { cout << -1 << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; string s1, s2; cin >> s1 >> s2; long long result = 0; for (long long i = 0; i < s1.size(); i++) { if (tolower(s1[i]) < tolower(s2[i])) { result = -1; break; } else if (tolower(s1[i]) > tolower(s2[i])) { result = 1; break; } } cout << result << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; vector<string> vec_splitter(string second) { second += ','; vector<string> res; while (!second.empty()) { res.push_back(second.substr(0, second.find(','))); second = second.substr(second.find(',') + 1); } return res; } void debug_out(vector<string> __attribute__((unused)) args, __attribute__((unused)) int idx, __attribute__((unused)) int LINE_NUM) { cerr << endl; } template <typename Head, typename... Tail> void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) { if (idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") "; stringstream ss; ss << H; cerr << args[idx] << " = " << ss.str(); debug_out(args, idx + 1, LINE_NUM, T...); } long long powermod(long long base, long long exp, long long mod) { long long result = 1; while (exp != 0) { if ((exp % 2) == 1) { result = (result * base) % mod; } base = (base * base) % mod; exp /= 2; } return result; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int tt = clock(); string a, b; cin >> a >> b; transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); for (int i = 0; i < min(a.size(), b.size()); i++) { if (a[i] - 'a' == b[i] - 'a') { continue; } else if (a[i] - 'a' < b[i] - 'a') { cout << -1 << endl; return 0; } else { cout << 1 << endl; return 0; } } if (a.size() < b.size()) { cout << -1 << endl; } else if (a.size() > b.size()) { cout << 1 << endl; } else { cout << 0 << endl; } cerr << "TIME = " << (double)1.0 * (clock() - tt) / CLOCKS_PER_SEC << " seconds" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int l = 0, k = 0; getline(cin, a); getline(cin, b); l = a.length(); k = b.length(); transform(a.begin(), a.end(), a.begin(), ::tolower); transform(b.begin(), b.end(), b.begin(), ::tolower); if (l == k) { for (int k = 0; k < l; k++) { if (k != l - 1) { if (a[k] == b[k]) { continue; } else if (a[k] > b[k]) { cout << "1" << endl; break; } else if (a[k] < b[k]) { cout << "-1" << endl; break; } } else { if (a[k] == b[k]) { cout << "0" << endl; break; } else if (a[k] > b[k]) { cout << "1" << endl; break; } else if (a[k] < b[k]) { cout << "-1" << endl; break; } } } } return 0; }
#include <bits/stdc++.h> using namespace std; int i = 0; bool b3 = false; long long MAXN = 10000; int arr[99999]; int arrin(int arr[], int n) { for (i = 0; i < n; i++) cin >> arr[i]; i = i - 1; return arr[i]; } void solve(int m[], int n) { sort(m, m + n); for (i = 0; i < n; i++) cout << m[i] << " "; cout << endl; } int main() { int n1 = 0, n2 = 0; string s1, s2; cin >> s1 >> s2; for (i = 0; i < s1.length(); i++) { if (s1[i] >= 65 && s1[i] <= 96) s1[i] = s1[i] + 32; if (s2[i] >= 65 && s2[i] <= 96) s2[i] = s2[i] + 32; if (s1[i] == s2[i]) continue; if (s1[i] != s2[i]) { b3 = true; if (s1[i] < s2[i]) { cout << -1 << endl; break; } else { cout << 1 << endl; break; } } } if (!b3) cout << 0 << endl; }
#include <bits/stdc++.h> using namespace std; void solve(string a, string b); int main() { string a, b; cin >> a; cin >> b; solve(a, b); return 0; } void solve(string a, string b) { int lA = 0, lB = 0; for (int i = 0; i < a.length(); i++) { a[i] = tolower(a[i]); b[i] = tolower(b[i]); } if (a > b) printf("%d", 1); else if (b > a) printf("%d", -1); else printf("%d", 0); }
#include <bits/stdc++.h> using namespace std; int a1[1000 + 10]; int main() { int a = 0, b = 0, z = 0, ab = 0, bb = 0, tk = 0, tz = 0; string a1, b1; cin >> a1 >> b1; a = a1.size(); for (int i = 0; i < a; i++) { char l = a1[i]; if ((int)l <= 90 && (int)l >= 65) { a1[i] = l + 32; } char h = b1[i]; if ((int)h <= 90 && (int)h >= 65) { b1[i] = h + 32; } } if (a1 == b1) { cout << 0; } for (int i = 0; i < a; i++) { if (a1[i] == b1[i]) { } else { int aaa = (int)a1[i]; int bbb = (int)b1[i]; if (aaa < bbb) { cout << -1; break; } else if (aaa > bbb) { cout << 1; break; } } } }
#include <bits/stdc++.h> using namespace std; int main() { string x, y; int i = 0; cin >> x; cin >> y; while (i < x.length()) { if (x[i] < 92) x[i] += 32; if (y[i] < 92) y[i] += 32; i++; } if (x > y) cout << 1 << endl; else if (x < y) cout << -1 << endl; else if (x == y) cout << 0 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string first; string second; cin >> first >> second; for (int i = 0; i < first.length(); i++) { int temp = first[i]; first[i] = tolower(temp); } for (int i = 0; i < second.length(); i++) { int temp = second[i]; second[i] = tolower(temp); } if (first > second) cout << 1 << endl; else if (first < second) cout << -1 << endl; else cout << 0 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; string toL(string s) { string res = ""; char c; for (int i = 0; i < (int)s.size(); i++) { c = s[i]; if ('A' <= c && c <= 'Z') c = c - 'A' + 'a'; res.push_back(c); } return res; } int main() { string s, t; int res = 0; cin >> s >> t; s = toL(s); t = toL(t); for (int i = 0; i < (int)s.size(); i++) { if (s[i] < t[i]) { res = -1; break; } else if (s[i] > t[i]) { res = 1; break; } } cout << res << endl; return 0; }
#include <bits/stdc++.h> #pragma GCC optimize(3) #pragma G++ optimize(3) using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); 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 << -1 << endl; else if (s2 < s1) cout << 1 << endl; else cout << 0 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int r = 0; cin >> a >> b; for (int i = 0; i < a.size() && r == 0; ++i) r = tolower(a[i]) - tolower(b[i]); if (r < 0) r = -1; else if (r > 0) r = 1; else r = 0; cout << r; }
#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 i = s1.compare(s2); if (i > 0) cout << "1"; else if (i < 0) cout << "-1"; else cout << "0"; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; for (int i = 0; i < a.size(); i++) { if (a[i] >= 'A' && a[i] <= 'Z') a[i] = tolower(a[i]); if (b[i] >= 'A' && b[i] <= 'Z') b[i] = tolower(b[i]); if (a[i] < b[i]) { cout << "-1" << endl; exit(0); } else if (a[i] > b[i]) { cout << "1" << endl; exit(0); } } cout << "0" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string n, c; cin >> n >> c; int z = 0, flag = 0; while (z < n.length()) { n[z] = tolower(n[z]); c[z] = tolower(c[z]); if (n[z] == c[z]) { flag = 1; } else if (int(n[z]) > int(c[z])) { cout << "1"; flag = 0; break; } else { cout << "-1"; flag = 0; break; } z++; } if (flag == 1) { cout << "0"; } }
#include <bits/stdc++.h> using namespace std; int main() { char A[102], B[102]; scanf("%s%s", A, B); int i; for (i = 0; i < strlen(A); i++) { if (A[i] >= 97 && A[i] <= 122) { A[i] = A[i] - 32; } if (B[i] >= 97 && B[i] <= 122) { B[i] = B[i] - 32; } } int x = 0; for (i = 0; i < strlen(A); i++) { if (A[i] != B[i]) { if (A[i] > B[i]) x = 1; else if (A[i] < B[i]) x = -1; break; } } printf("%d\n", x); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char s1[100], s2[100]; int i; cin >> s1; cin >> s2; for (i = 0; s1[i] != '\0'; i++) { if (s1[i] >= 97) s1[i] = s1[i] - 32; if (s2[i] >= 97) s2[i] = s2[i] - 32; if (s1[i] < s2[i]) { cout << "-1"; break; } if (s1[i] > s2[i]) { cout << "1"; break; } } if (s1[i] == '\0') cout << "0"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a >> b; long long s1 = 0, s2 = 0; int x = a.size(); for (int i = 0; i < x; i++) { if (a[i] >= 'A' && a[i] <= 'Z') a[i] = char(a[i] + 32); if (b[i] >= 'A' && b[i] <= 'Z') b[i] = char(b[i] + 32); } if (a == b) cout << 0 << endl; else if (a < b) cout << -1 << endl; else cout << 1 << endl; }
#include <bits/stdc++.h> int main() { char a[100], b[100]; short s[100], u[100], w = 0; scanf("%s %s", a, b); int n = strlen(a); for (int i = 0; i < n; i++) { s[i] = a[i]; u[i] = b[i]; if (u[i] <= 90) u[i] += 32; if (s[i] <= 90) s[i] += 32; if (s[i] == u[i]) w++; else if (s[i] > u[i]) { printf("1"); break; } else if (s[i] < u[i]) { printf("-1"); break; } } if (w == n) printf("0"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int l, j, k, i; char a[100], b[100]; cin >> a >> b; j = strlen(a); k = strlen(b); for (i = 0; i < j; i++) { if (a[i] > 96 && a[i] < 123) { a[i] = a[i] - 32; } } for (i = 0; i < k; i++) { if (b[i] > 96 && b[i] < 123) { b[i] = b[i] - 32; } } l = strcmp(a, b); cout << l; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char s1[101], s2[101]; cin >> s1 >> s2; for (int i = 0; s1[i] != '\0'; i++) { if (s1[i] >= 'A' && s1[i] <= 'Z') s1[i] = s1[i] + 32; if (s2[i] >= 'A' && s2[i] <= 'Z') s2[i] = s2[i] + 32; } if (strcmp(s1, s2) == 1) cout << "1"; else if (strcmp(s1, s2) == -1) cout << "-1"; else cout << "0"; return 0; }
#include <bits/stdc++.h> char a[101], b[101]; int main(void) { scanf("%s %s", a, b); int d = 0; for (int i = 0; a[i]; i++) { char x = ((a[i] >= 'A' && a[i] <= 'Z') ? (a[i] - 'A' + 'a') : a[i]), y = ((b[i] >= 'A' && b[i] <= 'Z') ? (b[i] - 'A' + 'a') : b[i]); if (x != y) { d = (x > y) ? 1 : -1; break; } } printf("%d\n", d); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { char s1[200], s2[200]; int d, i; cin.getline(s1, 200); cin.getline(s2, 200); for (i = 0; i < strlen(s1); i++) if (s1[i] >= 'A' && s1[i] <= 'Z') s1[i] = s1[i] - 'A' + 'a'; for (i = 0; i < strlen(s2); i++) if (s2[i] >= 'A' && s2[i] <= 'Z') s2[i] = s2[i] - 'A' + 'a'; d = strcmp(s1, s2); if (d == 0) cout << 0 << endl; else if (d < 0) cout << -1 << endl; else cout << 1 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; string s2; cin >> s >> s2; transform(s.begin(), s.end(), s.begin(), ::tolower); transform(s2.begin(), s2.end(), s2.begin(), ::tolower); if (s == s2) { printf("0\n"); } else if (s < s2) { printf("-1\n"); } else if (s > s2) { printf("1\n"); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string x, y; cin >> x >> y; int length = x.length(); for (int i = 0; i < length; i++) { int c = x[i]; if (islower(c)) x[i] = toupper(c); } int length1 = y.length(); for (int i = 0; i < length1; i++) { int c = y[i]; if (islower(c)) y[i] = toupper(c); } int xx = 0, yy = 0; for (int i = 0; i < length; i++) { int r = int(x[i]); xx += r; int d = int(y[i]); yy += d; } cout << x.compare(y); }
#include <bits/stdc++.h> using namespace std; int main() { string s1; string s2; cin >> s1; cin >> s2; int flag = 0; for (int i = 0; i < s1.length(); i++) { if (s1[i] > 64 && s1[i] < 91) { s1[i] = s1[i] + 32; } if (s2[i] > 64 && s2[i] < 91) { s2[i] = s2[i] + 32; } if (s1[i] == s2[i]) { continue; } if (s1[i] < s2[i]) { cout << "-1" << endl; flag = 1; break; } if (s1[i] > s2[i]) { cout << "1" << endl; flag = 1; break; } } if (flag == 0) { cout << "0" << endl; } return 0; }
#include <bits/stdc++.h> int main() { char A[100], B[100]; scanf("%s %s", A, B); int i, d, a, b; for (i = 0; i < strlen(A); i++) { a = A[i] > 96 ? A[i] % 96 : A[i] % 64; b = B[i] > 96 ? B[i] % 96 : B[i] % 64; d = a - b; if (d == 0 || d == 32 || d == -32) continue; else { if (d > 0) printf("1"); else printf("-1"); exit(0); } } printf("0"); }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2, s3, s4; 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'; }
#include <bits/stdc++.h> using namespace std; int main() { char str[100], sty[100]; int x, n; cin >> str >> sty; n = strlen(str); for (int j = 0; j < n; j++) if (str[j] >= 65 && str[j] <= 90) { str[j] = str[j] + 32; } for (int j = 0; j < n; j++) if (sty[j] >= 65 && sty[j] <= 90) { sty[j] = sty[j] + 32; } else { continue; } x = strcmp(str, sty); if (x == 0) { cout << "0"; } if (x < 0) { cout << "-1"; } if (x > 0) { cout << "1"; } return 0; }
#include <bits/stdc++.h> using namespace std; void kochik(string a, string b) { for (int i = 0; i < a.size(); i++) { if (a[i] >= 'a') a[i] -= 32; } for (int i = 0; i < b.size(); i++) { if (b[i] >= 'a') b[i] -= 32; } if (a > b) cout << "1"; if (a == b) cout << "0"; if (b > a) cout << "-1"; } int main(int argc, char *argv[]) { string a, b; cin >> a >> b; kochik(a, b); return EXIT_SUCCESS; }
#include <bits/stdc++.h> using namespace std; int compare(string s1, string s2) { if (s1.size() == 0) return 0; int ans = compare(s1.substr(1), s2.substr(1)); if (s1[0] == s2[0]) return ans; else if (s1[0] > s2[0]) return 1; else return -1; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ; string s1, s2; cin >> s1 >> s2; for (int i = 0; i < s1.size(); i++) { if (s1[i] >= 'A' && s1[i] <= 'Z') { s1[i] = 'a' + (s1[i] - 'A'); } if (s2[i] >= 'A' && s2[i] <= 'Z') { s2[i] = 'a' + (s2[i] - 'A'); } } int ans = compare(s1, s2); cout << ans << endl; return 0; }