当前位置:网站首页>1081 检查密码 (15 分)
1081 检查密码 (15 分)
2022-08-11 06:46:00 【呆比特】
题目要求:

代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine();
for (int i = 0; i < n; i++) {
String s = sc.nextLine();
if (s.length() < 6){
System.out.println("Your password is tai duan le.");
continue;
}else if (!s.matches("[a-zA-Z0-9.]+")){
System.out.println("Your password is tai luan le.");
continue;
}else if (!s.matches(".*[0-9].*")){
System.out.println("Your password needs shu zi.");
continue;
}else if (!s.matches(".*[a-zA-Z].*")){
System.out.println("Your password needs zi mu.");
continue;
}else {
System.out.println("Your password is wan mei.");
}
}
}
}
结果:
边栏推荐
猜你喜欢
随机推荐
How do you optimize the performance of your Unity project?
Get Pinduoduo product information operation details
LeetCode brushing series -- 46. Full arrangement
prometheus学习5altermanager
博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
微信小程序功能上新(2022.06.01~2022.08.04)
Service的两种状态形式
下一代 无线局域网--强健性
ssh服务攻防与加固
ROS 服务通信理论模型
技术分享 | 实战演练接口自动化如何处理 Form 请求?
国密规范 SM2 SM3 SM4
【软件测试】(北京)字节跳动科技有限公司二面笔试题
Service的两种启动方式与区别
常见激活函数及其导数
梅科尔工作室——BP神经网络
3GPP LTE/NR信道模型
matplotlib
年薪40W测试工程师成长之路,你在哪个阶段?
接入网、承载网、核心网是什么,交换机路由器是什么、这个和网络的协议有什么关系呢?









