简体   繁体   English

编写程序以检查用户输入的密码是否有效[关闭]

[英]Write a program to check the validity of password input by users [closed]

I am working on an assignment: 我正在做一个作业:

A website requires the users to input username and password to register. 网站要求用户输入用户名和密码进行注册。 Write a program to check the validity of password input by users. 编写程序以检查用户输入的密码的有效性。 Following are the criteria for checking the password: 以下是检查密码的标准:

  1. At least 1 letter between [az] [az]之间至少1个字母
  2. At least 1 number between [0-9] [0-9]之间至少1个数字
  3. At least 1 letter between [AZ] [AZ]之间至少1个字母
  4. At least 1 character from [$#@] [$#@]中的至少1个字符
  5. Minimum length of transaction password: 6 交易密码的最小长度:6
  6. Maximum length of transaction password: 12 交易密码的最大长度:12

Your program should accept a sequence of comma separated passwords and will check them according to the above criteria. 您的程序应接受一系列用逗号分隔的密码,并将根据上述条件进行检查。 Passwords that match the criteria are to be printed, each separated by a comma. 符合条件的密码将被打印,每个密码之间用逗号分隔。

Example
If the following passwords are given as input to the program: ABd1234@1,a F1#,2w3E*,2We3345 如果将以下密码作为该程序的输入: ABd1234@1,a F1#,2w3E*,2We3345
Then, the output of the program should be: ABd1234@1 然后,程序的输出应为: ABd1234@1

Here is my code so far: 到目前为止,这是我的代码:

TBD 待定

My question: 我的问题:

TBD 待定

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM