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 a = s[i];
  10. char b = t[i];
  11. if (a >= 'A' && a <= 'Z') a = a + ('a' - 'A');
  12. if (b >= 'A' && b <= 'Z') b = b + ('a' - 'A');
  13. if (a != b) return 0;
  14. i++;
  15. }
  16. if (s[i] == '\0' && t[i] == '\0') return 1;
  17. else return 0;
  18. }
  19. //メイン関数は書き換えなくてできます
  20. int main(){
  21. int ans;
  22. char s[100];
  23. char t[100];
  24. scanf("%s %s",s,t);
  25. printf("%s = %s -> ",s,t);
  26. ans = fuzzyStrcmp(s,t);
  27. printf("%d\n",ans);
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 5320KB
stdin
ABCD
stdout
ABCD =  -> 0