解题思路:
注意事项:
参考代码:
#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 人评分
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:683 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:731 |
哥德巴赫曾猜测 (C语言代码)浏览:1015 |
C语言程序设计教程(第三版)课后习题1.5 (C++代码)浏览:759 |
Pascal三角 (C语言代码)浏览:1188 |
妹子杀手的故事 (C语言代码)浏览:1232 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:475 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:701 |
三角形 (C语言代码)浏览:914 |
简单的a+b (C语言代码)浏览:577 |