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