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