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. char c1 = s[i];
  8. char c2 = t[i];
  9.  
  10. if (c1 >= 'A' && c1 <= 'Z') {
  11. c1 = c1 + ('a' - 'A');
  12. }
  13. if (c2 >= 'A' && c2 <= 'Z') {
  14. c2 = c2 + ('a' - 'A');
  15. }
  16.  
  17. if (c1 != c2) {
  18. return 0;
  19. }
  20.  
  21. i++;
  22. }
  23.  
  24. return 1;
  25. }
  26.  
  27. //メイン関数は書き換えなくてできます
  28. int main(){
  29. int ans;
  30. char s[100];
  31. char t[100];
  32. scanf("%s %s",s,t);
  33. printf("%s = %s -> ",s,t);
  34. ans = fuzzyStrcmp(s,t);
  35. printf("%d\n",ans);
  36. return 0;
  37. }
  38.  
Success #stdin #stdout 0s 5320KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1