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