fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. //関数の中だけを書き換えてください
  5. //同じとき1を返す,異なるとき0を返す
  6.  
  7. for(int i=0; (s[i]==t[i]) || ('A'<=s[i]&&s[i]<='Z' && 'a'<=t[i]&&t[i]<='z' && s[i]+32==t[i]) || ('a'<=s[i]&&s[i]<='z' && 'A'<=t[i]&&t[i]<='Z' && s[i]-32==t[i]); i++){
  8. if(s[i]=='\0') return 1;
  9. }
  10. return 0;
  11. }
  12.  
  13. //メイン関数は書き換えなくてできます
  14. int main(){
  15. int ans;
  16. char s[100];
  17. char t[100];
  18. scanf("%s %s",s,t);
  19. printf("%s = %s -> ",s,t);
  20. ans = fuzzyStrcmp(s,t);
  21. printf("%d\n",ans);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5276KB
stdin
abcd ABCD
stdout
abcd = ABCD -> 1