都是基础知识,看能不能想到而已
let str = readline(); function getSum(num){ let sum = 0; let res = new Set(); let arr = num.split(''); for(let v of arr){ if(v.charCodeAt() < 0 || v.charCodeAt() > 127){ throw new Error('输入值错误') }else{ res.add(v) } } console.log(res.size); } getSum(str)