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