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