fork download
  1. # include <stdio.h>
  2.  
  3.  
  4. int fuzzyStrcmp(char s[], char t[]){
  5. int i = 0;
  6.  
  7. while (s[i] != '\0' || t[i] != '\0') {
  8. char char_s = s[i];
  9. char char_t = t[i];
  10.  
  11. if (char_s >= 'A' && char_s <= 'Z') {
  12. char_s = char_s + 32;
  13. }
  14. if (char_t >= 'A' && char_t <= 'Z') {
  15. char_t = char_t + 32;
  16. }
  17.  
  18. if (char_s != char_t) {
  19. return 0;
  20. }
  21.  
  22. i++;
  23. }
  24.  
  25. return 1;
  26. //関数の中だけを書き換えてください
  27. //同じとき1を返す,異なるとき0を返す
  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 5324KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1