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