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