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