fork download
  1. # include <stdio.h>
  2.  
  3. int fuzzyStrcmp(char s[], char t[]){
  4. //関数の中だけを書き換えてください
  5. for(int i=0;s[i] != '\0';i++){
  6. for(int k=0;t[k] != '\0';i++){
  7. if('a' <= s[i] && s[i] <= 'z'){
  8. s[i] = s[i] - 32;
  9. }
  10. if('a' <= t[k] && t[k] <= 'z'){
  11. t[k] = t[k] - 32;
  12. }
  13.  
  14. if(s[i] == t[i]){
  15. return 1;
  16. }
  17. else{
  18. return 0;
  19. }
  20. }
  21. }
  22.  
  23. //同じとき1を返す,異なるとき0を返す
  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 0.01s 5280KB
stdin
ABCD abcD
stdout
ABCD = abcD -> 1