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