?我样例输入进去怎么出来了……一堆换行???

B3843 [GESP202306 三级] 密码合规

Somnus_Love @ 2024-06-21 19:56:13

(shooting__star)

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int l=s.length();
    string s2="";
    for(int i=0;i<l;i++)
    {
        if(s[i]==',')
        {
            int l2=s2.length();
            bool f1=0,f2=0,f3=0,f4=0;
            if(l2<6||l2>12)
            {
                continue;
            }
            for(int j=0;j<l2;j++)
            {
                if(s2[j]>='a'&&s2[j]<='z')
                {
                    f1=1;
                }
                else if(s2[j]>='A'&&s2[j]<='Z')
                {
                    f2=1;
                }
                else if(s2[j]>='0'&&s2[j]<='9')
                {
                    f3=1;
                }
                else if(s2[j]=='!'||s2[j]=='@'||s2[j]=='#'||s2[j]=='$')
                {
                    f4=1;
                }
                if(f1+f2+f3>=2&&f4)
                {
                    cout<<s2<<endl;
                }
                s2="";
            }
        }
        else
        {
            s2+=s[i];
        }
    }
    return 0;   
}

by Somnus_Love @ 2024-06-21 20:39:14

@Ivan422 6


by Somnus_Love @ 2024-06-21 20:48:24

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int l=s.length();
    string s2="";
    for(int i=0;i<l;i++)
    {
//      cout<<s[i];
        if(s[i]==',')
        {
//          cout<<s2<<endl;
            int l2=s2.length();
            int f1=0,f2=0,f3=0,f4=0,f5=0;
            if(l2<6||l2>12)
            {
                cout<<"";
            }
            for(int j=0;j<l2;j++)
            {
                if(s2[j]>='a'&&s2[j]<='z')
                {
                    f1=1;
                }
                else if(s2[j]>='A'&&s2[j]<='Z')
                {
                    f2=1;
                }
                else if(s2[j]>='0'&&s2[j]<='9')
                {
                    f3=1;
                }
                else if(s2[j]=='!'||s2[j]=='@'||s2[j]=='#'||s2[j]=='$')
                {
                    f4=1;
                }
                else
                {
                    f5=1;
                }
            }
            if(f1+f2+f3>=2&&f4==1&&f5==0)
            {
                cout<<s2<<endl;
            }
            s2="";
            l2=0;
        }
        else
        {
            s2=s2+s[i];
//          cout<<s2<<endl;
        }
    }
    int l2=s2.length();
    int f1=0,f2=0,f3=0,f4=0,f5=0;
    if(l2<6||l2>12)
    {
        cout<<"";
    }
    for(int j=0;j<l2;j++)
    {
        if(s2[j]>='a'&&s2[j]<='z')
        {
            f1=1;
        }
        else if(s2[j]>='A'&&s2[j]<='Z')
        {
            f2=1;
        }
        else if(s2[j]>='0'&&s2[j]<='9')
        {
            f3=1;
        }
        else if(s2[j]=='!'||s2[j]=='@'||s2[j]=='#'||s2[j]=='$')
        {
            f4=1;
        }
        else
        {
            f5=1;
        }
    }
    if(f1+f2+f3>=2&&f4==1&&f5==0)
    {
        cout<<s2<<endl;
    }
    s2="";
    l2=0;
    return 0;
}

So?Y o u w i l l......(?


by Ivan422 @ 2024-06-21 20:48:30

@Somnus_Love

你过了吗 (给个关注谢谢喵)


by Somnus_Love @ 2024-06-21 20:49:00

@Ivan422 还没qwq,等会儿啊,我大号关注你一下……


by Somnus_Love @ 2024-06-21 20:57:46

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int l=s.length();
    string s2="";
    for(int i=0;i<l;i++)
    {
//      cout<<s[i];
        if(s[i]==',')
        {
//          cout<<s2<<endl;
            int f1=0,f2=0,f3=0,f4=0,f5=0;
            if(s2.length()<6||s2.length()>12)
            {
                cout<<"";
            }
            for(int j=0;j<s2.length();j++)
            {
                if(s2[j]>='a'&&s2[j]<='z')
                {
                    f1=1;
                }
                else if(s2[j]>='A'&&s2[j]<='Z')
                {
                    f2=1;
                }
                else if(s2[j]>='0'&&s2[j]<='9')
                {
                    f3=1;
                }
                else if(s2[j]=='!'||s2[j]=='@'||s2[j]=='#'||s2[j]=='$')
                {
                    f4=1;
                }
                else
                {
                    f5=1;
                }
            }
            if(f1+f2+f3>=2&&f4==1&&f5==0)
            {
                cout<<s2<<endl;
            }
            s2="";
        }
        else
        {
            s2=s2+s[i];
//          cout<<s2<<endl;
        }
    }
    int l2=s2.length();
    int f1=0,f2=0,f3=0,f4=0,f5=0;
    if(l2<6||l2>12)
    {
        cout<<"";
    }
    for(int j=0;j<l2;j++)
    {
        if(s2[j]>='a'&&s2[j]<='z')
        {
            f1=1;
        }
        else if(s2[j]>='A'&&s2[j]<='Z')
        {
            f2=1;
        }
        else if(s2[j]>='0'&&s2[j]<='9')
        {
            f3=1;
        }
        else if(s2[j]=='!'||s2[j]=='@'||s2[j]=='#'||s2[j]=='$')
        {
            f4=1;
        }
        else
        {
            f5=1;
        }
    }
    if(f1+f2+f3>=2&&f4==1&&f5==0)
    {
        cout<<s2<<endl;
    }
    return 0;
}

wc还没过,,,

9命……


上一页 |