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