= 25: 弱(Weak)
= 0: 非常弱
对应输出为:
VERY_WEAK,
WEAK,
AVERAGE,
STRONG,
VERY_STRONG,
SECURE,
VERY_SECURE
输入描述:
输入一个string的密码
输出描述:
输出密码等级
输入例子:
38$@NoNoNo
输出例子:
VERY_SECURE
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
while(scan.hasNext())
{
String pwd=scan.nextLine();
int total=Length(pwd)+Letter(pwd)+number(pwd)+sign(pwd)+reward(pwd);
if(total>=90)
System.out.println(“VERY_SECURE”);
else if(total>=80)
System.out.println(“SECURE”);
else if(total>=70)
System.out.println(“VERY_STRONG”);
else if(total>=60)
System.out.println(“STRONG”);
else if(total>=50)
System.out.println(“AVERAGE”);
else if(total>=25)
System.out.println(“WEAK”);
else
System.out.println(“VERY_WEAK”);
}
}
//判断长度
static int Length(String str)
{
int score=0;
if(str.length()<=4){
score+=5;
}else if(str.length()>=8){
score+=25;
}else{
score+=10;
}
return score;
}
//判断字母
static int Letter(String str)
{
int score=0;
int xiao=0;
int da=0;
for(Character ch:str.toCharArray()){
if(ch>=‘a’ && ch<=‘z’) xiao=1;
else if(ch>=‘A’ && ch<=‘Z’) da=1;
}
if(xiao1 && da1) score=20;
else if(xiao0 && da0) score=0;
else score=10;
return score;
}
//判断数字
static int number(String str)
{
int score=0;
int count=0;
for(Character ch:str.toCharArray()){
if(ch>=‘0’ && ch<=‘9’) count++;
}
if(count==0) score=0;
else if(count==1) score=10;
else score=20;
return score;
}
//判断符号
static int sign(String str)
{
int score=0;
int count=0;
for(Character ch:str.toCharArray()){
if(!(ch>=‘0’ && ch<=‘9’) && !(ch.toLowerCase(ch)>=‘a’ && ch.toLowerCase(ch)<=‘z’)) count++;
}
if(count==0) score=0;
else if(count==1) score=10;
else score=25;
return score;
}
//奖励
static int reward(String str)
{
int score=0;
if(number(str)>0 && Letter(str)==20 && sign(str)>0)
score=5;
else if(number(str)>0 && Letter(str)>0 && sign(str)>0)
score=3;
else if(number(str)>0 && Letter(str)>0)
score=2;
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注Java)
最后
由于细节内容实在太多了,为了不影响文章的观赏性,只截出了一部分知识点大致的介绍一下,每个小节点里面都有更细化的内容!
小编准备了一份Java进阶学习路线图(Xmind)以及来年金三银四必备的一份《Java面试必备指南》
一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
介绍一下,每个小节点里面都有更细化的内容!
[外链图片转存中…(img-2M5gIi4M-1712896970855)]
小编准备了一份Java进阶学习路线图(Xmind)以及来年金三银四必备的一份《Java面试必备指南》
[外链图片转存中…(img-QEugrQFd-1712896970855)]
一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
[外链图片转存中…(img-VrE5crd5-1712896970856)]