题解 | #表示数字#
表示数字
https://www.nowcoder.com/practice/637062df51674de8ba464e792d1a0ac6
const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;
void async function () {
// Write your code here
while(line = await readline()){
// 把字符串里数字 replace
console.log(line.replace(/[0-9]+/g, (val) => '*' + val + '*'));
}
}()
查看5道真题和解析