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