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