fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i;
  5. char char_s, char_t;
  6.  
  7. for(i=0; s[i] != '\0' && t[i] != '\0'; i++){
  8. if('a' <= s[i] && s[i] <= 'z'){
  9. char_s = s[i] - 32;
  10. }else{
  11. char_s = s[i];
  12. }
  13.  
  14. if('a' <= t[i] && t[i] <= 'z'){
  15. char_t = t[i] - 32;
  16. }else{
  17. char_t = t[i];
  18. }
  19. }
  20.  
  21. if(char_s != char_t){
  22. return 0;
  23. }
  24.  
  25. if(s[i]=='\0') return 1;
  26.  
  27. }
  28.  
  29. int main(){
  30. int ans;
  31. char s[100];
  32. char t[100];
  33. scanf("%s %s",s,t);
  34. printf("%s = %s -> ",s,t);
  35. ans = fuzzyStrcmp(s,t);
  36. printf("%d\n",ans);
  37. return 0;
  38. }
Success #stdin #stdout 0s 5320KB
stdin
abc Abk
stdout
abc = Abk -> 0