当前位置:网站首页>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.");
}
}
}
}
结果:
边栏推荐
猜你喜欢
随机推荐
Edge provides label grouping functionality
【软件测试】(北京)字节跳动科技有限公司终面HR面试题
下一代 无线局域网--强健性
exness:黄金1800关口遇阻,静待美国CPI出炉
unable to extend table xxx by 1024 in tablespace xxxx
ssh服务攻防与加固
tf中矩阵乘法
Amazon API interface Daquan
2022-08-09 Group 4 Self-cultivation class study notes (every day)
微信小程序功能上新(2022.06.01~2022.08.04)
【软件测试】(北京)字节跳动科技有限公司二面笔试题
2022-08-09 第四小组 修身课 学习笔记(every day)
《猪猪1984》NFT 作品集将上线 The Sandbox 市场平台
Multiscale communication in cortical-cortical networks
ROS 服务通信理论模型
Douyin API interface
【LeetCode每日一题】——844.比较含退格的字符串
Pico neo3在Unity中的交互操作
STM32CUBEIDE(11)----输出PWM及修改PWM频率与占空比
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法