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