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