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