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