短视频开发,检查密码位数是否正确

2020-11-19 14:41:25 浏览数 (1)

短视频开发,检查密码位数是否争取的相关代码

代码语言:javascript复制
#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;
}

以上就是短视频开发,检查密码位数是否争取的相关代码, 更多内容欢迎关注之后的文章

0 人点赞