📌  相关文章
📜  javascript验证输入值hackerrank - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:28.850000             🧑  作者: Mango

代码示例1
function makeInputVerifier(minimum, maximum) {
  // write your code here
  var mini=minimum;
  var maxi=maximum;
}
function verify(val){
    if(val=mini && val<=maxi)return "Input is in range";
    return "Input is more than maximum value";
}


function main() {
  const ws = fs.createWriteStream(process.env.OUTPUT_PATH);

  const min = parseInt(readLine().trim());
  const max = parseInt(readLine().trim());
  const verify = makeInputVerifier(min, max);

  const input = parseInt(readLine().trim());
  const result = verify(input);

  ws.write(`${result}\n`);
  ws.end();
}