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