题解 | #X游戏#
X游戏
http://www.nowcoder.com/practice/41b0f2f813da4c0cb68ef298b60a19a2
javascript V8
var line = parseInt(readline()) var reg = new RegExp('\(3)|(4)|(7)') var reg2 = new RegExp('\(2)|(5)|(6)|(9)') function goodNum(line) { var count = 0 for(var i=1; i<=line; i++) { var str = i+'' if(reg.test(str)) { continue } if(!reg2.test(str)) { continue } count++ } return count } console.log(goodNum(line))