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