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