fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. //関数の中だけを書き換えてください
  5. //同じとき1を返す,異なるとき0を返す
  6. int i=0;
  7.  
  8.  
  9. while( s[i]!= '\0' && s[i]!= '\0')
  10. {
  11. if(s[i]!=t[i]){
  12. return 0;
  13. }
  14. i++;
  15. }
  16.  
  17. if(s[i]=='\0' && t[i]=='\0')
  18. {
  19. return 1;
  20. }
  21.  
  22. return 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 0s 5316KB
stdin
abCD abCD
stdout
abCD = abCD -> 1