shenjiaming


私信TA

用户名:dotcpp0687408

访问量:241

签 名:

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

  自我简介:

解题思路:

注意事项:

参考代码:

#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 人评分

  评论区