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