fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i = 0;
  5. while(s[i]!='\0'&&t[i]!='\0'){
  6. char c1 = s[i];
  7. char c2 = t[i];
  8.  
  9. if(c1>='A'&&c1<='Z'){
  10. c1 = c1 +32;
  11. }
  12. if(c2>='A'&&c2<='Z'){
  13. c2 = c2 +32;
  14. }
  15.  
  16. if(c1!=c2){
  17. return 0;
  18. }
  19. i++;
  20. }
  21. if(s[i]=='\0'&&t[i]=='\0'){
  22. return 1;
  23. }
  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 0s 5348KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1