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