const readline = require(‘readline-sync‘)//引用readline-sync
let s = 2;//错误的次数
for (let i = 0; i < 3; i++) {
console.log(‘请输入名:(由英文组成)‘);
let user = readline.question();
console.log(‘请输入密码:(由数字组成)‘);
let password = readline.question();
let arr = [‘yang‘, ‘123456‘];
if (user == arr[0] && password == arr[1]) {
console.log(‘欢迎您,登陆成功‘);
for (let yewu = 1; yewu >= 1; yewu++) {
console.log(‘请选择业务:\n1.存款: \n2.取款: \n3.查看: \n4.退出:‘);
let yewu = readline.question() - 0;
let money = 3000;
if (yewu > 4) {
console.log(‘对不起你输入的有误,请重新输入:‘)
continue;
}
switch (yewu) {
case 1:
//存款money2为钱变化后的总数