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