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 char_s = s[i];
  8. char char_t = t[i];
  9.  
  10. if (char_s >= 'A' && char_s <= 'Z') {
  11. char_s +='a'-'A';
  12. }
  13. if (char_t >= 'A' && char_t <= 'Z') {
  14. char_t +='a'-'A';
  15. }
  16. if (char_s != char_t) {
  17. return 0;}
  18.  
  19. i++;
  20. }
  21. if (s[i] != '\0' || t[i] != '\0') {
  22. return 0;
  23. }
  24.  
  25. return 1;}
  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 0.01s 5280KB
stdin
abx abc
stdout
abx = abc -> 0