fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4.  
  5. int i = 0;
  6. char a, b;
  7.  
  8. while(s[i] != '\0' || t[i] != '\0'){
  9. a = s[i];
  10. b = t[i];
  11.  
  12. if(a >= 'A' && a <= 'Z'){
  13. a = a + 32;
  14. }
  15.  
  16. if(b >= 'A' && b <= 'Z'){
  17. b = b + 32;
  18. }
  19.  
  20. if(a != b){
  21. return 0;
  22. }
  23.  
  24. i++;
  25. }
  26.  
  27. return 1;
  28. }
  29.  
  30. //メイン関数は書き換えなくてできます
  31. int main(){
  32. int ans;
  33. char s[100];
  34. char t[100];
  35. scanf("%s %s",s,t);
  36. printf("%s = %s -> ",s,t);
  37. ans = fuzzyStrcmp(s,t);
  38. printf("%d\n",ans);
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0s 5320KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1