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