fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int count=0,i;
  5. for(i=0;s[i]!='\0';i++){
  6. if(('a'<=s[i] && s[i]<='z')||('A'<=s[i] && s[i]<='Z')){
  7. if(s[i]==t[i]||s[i]==(t[i] -32)){
  8. count++;}}
  9. else{
  10. if(s[i]==t[i])
  11. count++;}
  12.  
  13. }
  14. if(count==i-1)
  15. return 1;
  16. else
  17. return 0;
  18. }
  19.  
  20. //メイン関数は書き換えなくてできます
  21. int main(){
  22. int ans;
  23. char s[100];
  24. char t[100];
  25. scanf("%s %s",s,t);
  26. printf("%s = %s -> ",s,t);
  27. ans = fuzzyStrcmp(s,t);
  28. printf("%d\n",ans);
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 5316KB
stdin
abCD1 AbCd1
stdout
abCD1 = AbCd1 -> 1