短视频开发,检查密码位数是否争取的相关代码
#include <stdio.h> #include <string.h> int main() { int n,len,flag1,flag2,flag3; scanf("%d",&n); getchar(); char ch[100]; while(n--) { gets(ch); len=strlen(ch); flag1=flag2=flag3=0; for(int i=0;i<len;i++) { if(ch[i]>='0'&&ch[i]<='9') flag1=1; else if((ch[i]>='a'&&ch[i]<='z')||(ch[i]>='A'&&ch[i]<='Z')) flag2=1; else if(ch[i]!='.') flag3=1; } if(len<6) printf("Your password is tai duan le.\n"); else if(flag3) printf("Your password is tai luan le.\n"); else if(flag1&&flag2==0) printf("Your password needs zi mu.\n"); else if(flag1==0&&flag2) printf("Your password needs shu zi.\n"); else printf("Your password is wan mei.\n"); } return 0; }
以上就是短视频开发,检查密码位数是否争取的相关代码, 更多内容欢迎关注之后的文章
原创声明,本文系作者授权云+社区发表,未经许可,不得转载。
如有侵权,请联系 yunjia_community@tencent.com 删除。
我来说两句