fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i=0;
  5. char a=0;
  6. char b=0;
  7. while(s[i] != '\0' || t[i] != '\0'){
  8. if(s[i] >= 'A' && s[i] <= 'Z'){
  9. a = s[i]+32;
  10. }
  11. else{
  12. a = s[i];
  13. }
  14.  
  15. if(t[i] >= 'A' && t[i] <= 'Z'){
  16. b = t[i]+32;
  17. }
  18. else{
  19. b = t[i];
  20. }
  21.  
  22. if(a != b){
  23. return 0;
  24. }
  25. i++;
  26. }
  27. return 1;
  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. }
  41.  
Success #stdin #stdout 0s 5328KB
stdin
abCD AbCd
stdout
abCD = AbCd -> 1