fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. //関数の中だけを書き換えてください
  5. //同じとき1を返す,異なるとき0を
  6. int i;
  7.  
  8. for(i = 0; s[i] != '\0' || t[i] != '\0'; i++){
  9. char a = s[i];
  10. char b = t[i];
  11.  
  12. // 小文字を大文字に変換
  13. if(a >= 'a' && a <= 'z') a -= 32;
  14. if(b >= 'a' && b <= 'z') b -= 32;
  15.  
  16. // 比較
  17. if(a != b){
  18. return 0;
  19.  
  20. }
  21.  
  22. return 1;
  23. }
  24. }
  25.  
  26. //メイン関数は書き換えなくてできます
  27. int main(){
  28. int ans;
  29. char s[100];
  30. char t[100];
  31. scanf("%s %s",s,t);
  32. printf("%s = %s -> ",s,t);
  33. ans = fuzzyStrcmp(s,t);
  34. printf("%d\n",ans);
  35. return 0;
  36. }
  37.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
P*�;� =  -> 0