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