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