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