fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. for (int i = 0;; i++) {
  5. char cs = s[i];
  6. char ct = t[i];
  7. if (cs >= 'A' && cs <= 'Z') cs = cs - 'A' + 'a';
  8. if (ct >= 'A' && ct <= 'Z') ct = ct - 'A' + 'a';
  9. if (cs != ct) return 0;
  10. if (cs == '\0') return 1;
  11. }
  12. return 0;
  13. //関数の中だけを書き換えてください
  14. //同じとき1を返す,異なるとき0を返す
  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