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