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