Commit 5f5679c1 authored by amonsiri unkham's avatar amonsiri unkham

ขอ 2 คะแนนคะ

parent f96d1d0c
const rl = require('readline')
const r = rl.createInterface({
input: process.stdin,
output: process.stdout
});
let i = 0
console.log('กรุณากรอกชื่อ :')
r.on('line',(line) =>{
if(i==0){
console.log('กรุณากรอกเบอร์:')
name = line
i++
}else if (i==1){
console.log('กรุณากรอกปี พ.ศ. :')
phone = line
i++
}else if (i==2){
console.log(`สวัสดีคุณ ${name} เบอร์ ${phone} อายุ ${2560-line}`);
r.close();
}
})
{
"name": "week03",
"version": "1.0.0",
"description": "การบ้าน03",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"homework03"
],
"author": "5811403936",
"license": "ISC"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment