FreeCodeCampChina / freecodecamp.cn

FCC China open source codebase and curriculum. Learn to code and help nonprofits.
https://fcc.asia/
Other
37.02k stars 1.38k forks source link

Don't know where is wrong ... #620

Closed dadafawang closed 5 years ago

dadafawang commented 5 years ago

var count = 0; function cc(card) { // 请把你的代码写在这条注释以下 switch(card){ case 2: case 3: case 4: case 5: case 6: count++; break;
case 10: case "J": case "Q": case "K": case "A": count--; break; default: count=0; }
if(count>0){
return count+" Bet"; }else{
return count+" Hold"; } // 请把你的代码写在这条注释以上 } // 你可以在这里添加/删除 cc 方法的调用来测试结果 // 提示: 左边只会显示最后一次执行的返回值 cc(2); cc(3); cc(7); cc('K'); cc('A');

image

dadafawang commented 5 years ago

delete default: count=0; then it is OK !