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