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