fork download
  1. #include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i = 0;
  5. char x,y;
  6. while (s[i] != '\0' && t[i] != '\0') {
  7. x = s[i];
  8. y = t[i];
  9. if (x >= 'a' && x <= 'z') {
  10. x = x - 'a' + 'A';
  11. }
  12. if (y >= 'a' && y <= 'z') {
  13. y = y - 'a' + 'A';
  14. }
  15. if (x != y) {
  16. return 0;
  17. }
  18.  
  19. i++;
  20. }
  21. if (s[i] == '\0' && t[i] == '\0') {
  22. return 1;
  23. } else {
  24. return 0;
  25. }
  26. }
  27.  
  28. // メイン関数はそのままでOK
  29. int main(void){
  30. int ans;
  31. char s[100];
  32. char t[100];
  33.  
  34. scanf("%99s %99s", s, t);
  35. printf("%s = %s -> ", s, t);
  36. ans = fuzzyStrcmp(s, t);
  37. printf("%d\n", ans);
  38.  
  39. return 0;
  40. }
Success #stdin #stdout 0.01s 5304KB
stdin
abc Abc
stdout
abc = Abc -> 1