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. if('a'<=s[i]&&s[i]<='z'){
  7. s[i]=s[i]-32;
  8. }
  9. }
  10. for(int i=0;t[i]!='\0';i++){
  11. if('a'<=t[i]&&t[i]<='z'){
  12. t[i]=t[i]-32;
  13. }
  14. }
  15. for(int i=0;s[i]==t[i];i++){
  16. if(s[i]=='\0') return 1;
  17.  
  18. }
  19.  
  20. return 0;
  21. }
  22.  
  23.  
  24. //関数の中だけを書き換えてください
  25. //同じとき1を返す,異なるとき0を返す
  26.  
  27. //メイン関数は書き換えなくてできます
  28. int main(){
  29. int ans;
  30. char s[100];
  31. char t[100];
  32. scanf("%s %s",s,t);
  33. printf("%s = %s -> ",s,t);
  34. ans = fuzzyStrcmp(s,t);
  35. printf("%d\n",ans);
  36. return 0;
  37. }
  38.  
Success #stdin #stdout 0.01s 5288KB
stdin
Abbb abBB
stdout
Abbb = abBB -> 1