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