fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define GG ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  4. int main() {
  5. string s1,s2; cin>>s1>>s2; int n=s1.size(),x=0;
  6. for(int i=0;i<n;i++)
  7. { if (s1[i]>='A'&&s1[i]<='Z')
  8. s1[i]+='a'-'A';
  9. if (s2[i]>='A'&&s2[i]<='Z')
  10. s2[i]+='a'-'A';
  11. }
  12. for(int i=0;i<n;i++)
  13. { if(s1[i]>s2[i])
  14. { x=1; break; }
  15. else if(s1[i]<s2[i])
  16. { x=-1; break; }
  17. }
  18. cout<<x;
  19. return 0; }
Success #stdin #stdout 0.01s 5280KB
stdin
abs
abz
stdout
-1