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