const countScore = (password) => { let score = 0;// 总得分 let upper = false;// 大写字符是否存在 let lower = false;// 小写字符是否存在 let num = 0;// 数字几个 let char = 0;// 符号几个 for(let i of password){ if(i >= 'A' && i <= 'Z'){ upper = true; }else if( i >= 'a' && i <= 'z'){ lower = true; }else if(i >= '0' && i <= '9'){ num += 1; }else{ char += 1; } } // 密码长度 if(password.length <= 4){ score += 5; }else if(password.length <= 7){ score += 10; }else{ score += 25; } // 字母 if(upper && lower){ score += 20; }else if((upper && !lower) || (!upper&&lower)){ score +=10 } // 数字 if(num === 1){ score += 10; }else if(num > 1){ score += 20; } // 符号 if(char === 1){ score += 10; }else if(char > 1){ score += 25; } // 奖励 if(upper && lower && num && char){ score += 5 }else if((upper||lower) && num && char){ score += 3; }else if(num && char){ score += 2; } if (score >= 90) { return "VERY_SECURE"; } else if (score >= 80) { return "SECURE"; } else if (score >= 70) { return "VERY_STRONG"; } else if (score >= 60) { return "STRONG"; } else if (score >= 50) { return "AVERAGE"; } else if (score >= 25) { return "WEAK"; } else { return "VERY_WEAK"; } } const readline = require('readline'); const rl = readline.createInterface({ input:process.stdin, output:process.stdout }); rl.on('line',(line)=>{ console.log(countScore(line)) })