shenjiaming


私信TA

用户名:dotcpp0687408

访问量:233

签 名:

等  级
排  名 799
经  验 3581
参赛次数 0
文章发表 16
年  龄 18
在职情况 学生
学  校 上海大学
专  业 计算机

  自我简介:

TA的其他文章

解题思路:

注意事项:

参考代码:

#include<iostream> 

using namespace std;


int main()

{

string str;

int n;

cin>>n;

string s="~!@#$%^";

getchar();

while(n--&&getline(cin,str))

{

int a=0,b=0,c=0,d=0;

if(str.size()<8||str.size()>16)

{

cout<<"NO"<<endl;

}

else

{

for(int i=0;i<str.size();i++)

{

if(str[i]>='A'&&str[i]<='Z')

a=1;

else if(str[i]>='a'&&str[i]<='z')

b=1;

else if(str[i]>='0'&&str[i]<='9')

c=1;

else if(s.find(str[i])!=s.npos)

d=1;

}

if(a+b+c+d<3)

{

cout<<"NO"<<endl;

}

else

{

cout<<"YES"<<endl;

}

}

}

return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区