fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i;
  5. int answer;
  6. for(i = 0; s[i] != '\0'; i++){
  7. if(s[i] != t[i] && (s[i] - 32 == t[i] || s[i] + 32 == t[i])){
  8. answer = 1;
  9. } else if(s[i] == t[i]){
  10. answer = 1;
  11. } else {
  12. answer = 0;
  13. }
  14. }
  15. if(t[i] != '\0'){
  16. answer = 0;
  17. }
  18.  
  19. return answer;
  20. //関数の中だけを書き換えてください
  21. //同じとき1を返す,異なるとき0を返す
  22. }
  23.  
  24. //メイン関数は書き換えなくてできます
  25. int main(){
  26. int ans;
  27. char s[100];
  28. char t[100];
  29. scanf("%s %s",s,t);
  30. printf("%s = %s -> ",s,t);
  31. ans = fuzzyStrcmp(s,t);
  32. printf("%d\n",ans);
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0.01s 5284KB
stdin
abCD AbCe
stdout
abCD = AbCe -> 0