fork(1) download
  1. # include <stdio.h>
  2. #include <ctype.h>
  3.  
  4. int fuzzyStrcmp(char s[], char t[]){
  5. while (*s != '\0' && *t != '\0') {
  6. if (tolower(*s) != tolower(*t)) {
  7. return 0; // 異なる文字があれば0を返す
  8. }
  9. s++;
  10. t++;
  11. }
  12. return (*s == '\0' && *t == '\0') ? 1 : 0;
  13. }
  14.  
  15. int main(){
  16. int ans;
  17. char s[100];
  18. char t[100];
  19. scanf("%s %s",s,t);
  20. printf("%s = %s -> ",s,t);
  21. ans = fuzzyStrcmp(s,t);
  22. printf("%d\n",ans);
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 5284KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1