fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i = 0;
  5.  
  6. while(s[i] != '\0' && t[i] != '\0'){
  7. if(tolower(s[i]) != tolower(t[i])){
  8. return 0;
  9. }
  10. i++;
  11. }
  12.  
  13. if(s[i] == '\0' && t[i] == '\0'){
  14. return 1;
  15. }
  16.  
  17. return 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. }
  31.  
Success #stdin #stdout 0s 5308KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1