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 char_s = s[i];
  7. char char_t = t[i];
  8. if (char_s >= 'A' && char_s <= 'Z') {
  9. char_s = char_s + ('a' - 'A');
  10. }
  11. if (char_t >= 'A' && char_t <= 'Z') {
  12. char_t = char_t + ('a' - 'A');
  13. }
  14. if (char_s != char_t) {
  15. return 0;
  16. }
  17. i++;
  18. }
  19. if (s[i] == '\0' && t[i] == '\0') {
  20. return 1;
  21. }else{
  22. return 0;
  23. }
  24. //関数の中だけを書き換えてください
  25. //同じとき1を返す,異なるとき0を返す
  26. }
  27.  
  28. //メイン関数は書き換えなくてできます
  29. int main(){
  30. int ans;
  31. char s[100];
  32. char t[100];
  33. scanf("%s %s",s,t);
  34. printf("%s = %s -> ",s,t);
  35. ans = fuzzyStrcmp(s,t);
  36. printf("%d\n",ans);
  37. return 0;
  38. }
  39.  
Success #stdin #stdout 0s 5312KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1