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