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