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