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