当前位置:网站首页>1081 Check Password (15 points)
1081 Check Password (15 points)
2022-08-11 07:48:00 【dumb bit】
题目要求:
代码:
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.");
}
}
}
}
结果:
边栏推荐
猜你喜欢
随机推荐
进制转换间的那点事
1046 划拳 (15 分)
为什么C#中对MySQL不支持中文查询
Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
1106 2019数列 (15 分)
SQL sliding window
Redis source code-String: Redis String command, Redis String storage principle, three encoding types of Redis string, Redis String SDS source code analysis, Redis String application scenarios
TF中的四则运算
2022-08-09 Group 4 Self-cultivation class study notes (every day)
SQL滑动窗口
MindManager2022全新正式免费思维导图更新
Redis source code: how to view the Redis source code, the order of viewing the Redis source code, the sequence of the source code from the external data structure of Redis to the internal data structu
Item 2 - Annual Income Judgment
maxwell concept
TF中的One-hot
1056 Sum of Combinations (15 points)
【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
CIKM 2022 AnalytiCup Competition: 联邦异质任务学习
1003 我要通过 (20 分)
PIXHAWK飞控使用RTK