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.  
  25. while(s[p]!='\0' || t[p]!='\0'){
  26. if(s[p]==t[p] || ((65<=s[p] && s[p]<=90) && s[p]+32==t[p]) || ((65<=t[p] && t[p]<=90) && s[p]==t[p]+32)){
  27. }else{
  28. return 0;
  29. }
  30. p++;
  31. }
  32. return 1;
  33. }
  34.  
Success #stdin #stdout 0s 5308KB
stdin
123
QRS
stdout
123 = QRS -> 0