fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. //関数の中だけを書き換えてください
  5. //同じとき1を返す,異なるとき0を返す
  6. int i = 0;
  7.  
  8. while (s[i] != '\0' || t[i] != '\0') {
  9. char char_s = s[i];
  10. char char_t = t[i];
  11.  
  12. if (char_s >= 'A' && char_s <= 'Z') {
  13. char_s = char_s + 32;
  14. }
  15.  
  16. if (char_t >= 'A' && char_t <= 'Z') {
  17. char_t = char_t + 32;
  18. }
  19.  
  20. if (char_s != char_t) {
  21. return 0;
  22. }
  23.  
  24. i++;
  25. }
  26.  
  27. return 1;
  28. }
  29.  
  30. int main(){
  31. int ans;
  32. char s[100];
  33. char t[100];
  34. scanf("%s %s",s,t);
  35. printf("%s = %s -> ",s,t);
  36. ans = fuzzyStrcmp(s,t);
  37. printf("%d\n",ans);
  38. return 0;
  39. }
  40.  
Success #stdin #stdout 0s 5320KB
stdin
0 0
stdout
0 = 0 -> 1