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