fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. int i = 0;
  5.  
  6. while(s[i] != '\0' && t[i] != '\0'){
  7. if(s[i] == t[i]){
  8. i++ ;
  9. }else if(s[i] == t[i] + 32 || s[i] + 32 == t[i]){
  10. i++ ;
  11. }else{
  12. return 0;
  13. }
  14. }
  15.  
  16. if(s[i] == '\0' && t[i] == '\0'){
  17. return 1;
  18. }else{
  19. return 0;
  20. }
  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 5316KB
stdin
abCd AbCd
stdout
abCd = AbCd -> 1