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