当前位置:网站首页>Check password
Check password
2022-07-02 14:30:00 【Name it as father】
One 、 Title Description
This topic requires you to help the user registration module of a website write a small function of password legitimacy check . The website requires that the password set by users must be no less than 6 Characters make up , And can only have English letters 、 Numbers and decimal points .
, There must also be both letters and numbers .
Two 、 Input format
The first line of input gives a positive integer N(≤ 100), And then N That's ok , Each line gives a password set by the user , For no more than 80 A non empty string of characters , End with a carriage return .
Be careful : The title guarantees that there is no input with only decimal point .
3、 ... and 、 Output format
Password for each user , Output system feedback information in one line , Below 5 Kind of :
- If the password is legal , Output
Your password is wan mei.
; - If the password is too short , Whether legal or not , All output
Your password is tai duan le.
; - If the password length is legal , But there are illegal characters , The output
Your password is tai luan le.
; - If the password length is legal , But only letters, no numbers , The output
Your password needs shu zi.
; - If the password length is legal , But only numbers, no letters , The output
Your password needs zi mu.
.
Four 、 sample input
5
123s
zheshi.wodepw
1234.5678
WanMei23333
pass*word.6
sample output
Your password is tai duan le.
Your password needs shu zi.
Your password needs zi mu.
Your password is wan mei.
Your password is tai luan le.
5、 ... and 、 Code demonstration
#include<stdio.h>
#include<string.h>
int main()
{
int n;
scanf("%d", &n);// Output n
getchar();
char a[81];
int len;
while (n--)
{
int cha = 0, num = 0, point = 0, other = 0;
gets(a);
len = strlen(a);
if (len < 6) {
printf("Your password is tai duan le.\n");
continue;
}
else for (int i = 0; i < len; i++)
{
if (a[i] >= '0' && a[i] <= '9')num++;
else if (a[i] >= 'a' && a[i] <= 'z' || a[i] >= 'A' && a[i] <= 'Z')cha++;
else if (a[i] == '.')point++;
else other++;
}
if (other != 0)printf("Your password is tai luan le.\n");
else if (cha != 0 && num == 0)printf("Your password needs shu zi.\n");
else if (cha == 0 && num != 0)printf("Your password needs zi mu.\n");
else printf("Your password is wan mei.\n");
}
return 0;
}
边栏推荐
- kaggle如何使用utility script
- 数据湖(十一):Iceberg表数据组织与查询
- There is no solution to the decryption error of the remote user 'sa' and the service master password mapped from the remote server 'to the local user' (null) /sa '
- [development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
- 途家木鸟美团夏日折扣对垒,门槛低就一定香吗?
- Solving the longest subsequence with linear DP -- three questions
- Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
- In 2021, the global revenue of structural bolts was about $796.4 million, and it is expected to reach $1097.6 million in 2028
- 《可供方案开发》口算训练机/数学宝/儿童口算宝/智能数学宝 LCD液晶显示驱动IC-VK1622(LQFP64封装),原厂技术支持
- 【虹科技术分享】如何测试 DNS 服务器:DNS 性能和响应时间测试
猜你喜欢
Fabric.js 上划线、中划线(删除线)、下划线
途家木鸟美团夏日折扣对垒,门槛低就一定香吗?
Penetrate the remote connection database through the Intranet
Fabric. Usage of JS eraser (including recovery function)
Stm32-dac Experiment & high frequency DAC output test
测试框架TestNG的使用(二):testNG xml的使用
PHP linked list creation and traversal
The global special paper revenue in 2021 was about $27 million, and it is expected to reach $35 million in 2028. From 2022 to 2028, the CAGR was 3.8%
【虹科技术分享】如何测试 DNS 服务器:DNS 性能和响应时间测试
Whole house Wi Fi: a pain point that no one can solve?
随机推荐
万物生长大会在杭召开,当贝入选2022中国未来独角兽TOP100榜单
freemarker的使用
mongodb的认识
In 2021, the global styrene butadiene styrene (SBS) revenue was about $3722.7 million, and it is expected to reach $5679.6 million in 2028
Go operation redis
[development environment] StarUML tool (download software | StarUML installation | StarUML creation project)
Story point vs. Human Sky
给Android程序员的一些面试建议「建议收藏」
Development and design of animation surrounding mall sales website based on php+mysql
A white hole formed by antineutrons produced by particle accelerators
HMS core machine learning service helps zaful users to shop conveniently
C crystal report printing
Solve the problem that openocd fails to burn STM32 and cannot connect through SWD
Yyds dry goods inventory software encryption lock function
STM32标准固件库函数名记忆(二)
kaggle如何使用utility script
uniapp自动化测试学习
Golang 快速生成数据库表的 model 和 queryset
TeamTalk源码分析之win-client
Advanced usage of C language -- function pointer: callback function; Conversion table