杭电2043密码
来源:互联网 发布:js input 变成 select 编辑:程序博客网 时间:2024/05/02 04:54
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int M;
cin>>M;
cin.ignore();
while (M--)
{
string str;
int flag=0,a=0,b=0,c=0,d=0;
getline(cin,str);
if(str.size()>=8&&str.size()<16)
{
for(int i=0;i<str.size();++i)
{
if(isupper(str.at(i)))
a=1;
else if(islower(str.at(i)))
b=1;
else if(isdigit(str.at(i)))
c=1;
else
d=1;
}
flag=a+b+c+d;
if(flag>=3)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
else
cout<<"NO"<<endl;
}
return 0;
#include<string>
#include<cctype>
using namespace std;
int main()
{
int M;
cin>>M;
cin.ignore();
while (M--)
{
string str;
int flag=0,a=0,b=0,c=0,d=0;
getline(cin,str);
if(str.size()>=8&&str.size()<16)
{
for(int i=0;i<str.size();++i)
{
if(isupper(str.at(i)))
a=1;
else if(islower(str.at(i)))
b=1;
else if(isdigit(str.at(i)))
c=1;
else
d=1;
}
flag=a+b+c+d;
if(flag>=3)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
else
cout<<"NO"<<endl;
}
return 0;
}
本想排序后用二分,但思路貌似有些混乱,只能说资质不够啊
0 0
- 杭电2043 密码
- 杭电2043 密码
- 杭电2043 密码
- 杭电2043密码
- 【杭电】[2043]密码
- 杭电 2043 密码
- 密码 杭电 2043
- 杭电ACM 2043 密码
- 杭电ACM 2043 密码
- 杭电 ACM 2043 密码
- 杭电oj 2043 密码
- 【杭电-oj】-2043-密码
- 杭电OJ_(2043)密码
- 【杭电oj】2043 - 密码(水)
- 杭电2043——密码
- 【杭电oj2043】密码
- 杭电 1287 破译密码
- 杭电 1287 破译密码
- web知识点的总结与分析(1)(应该对你有用)
- 《unix网络编程》(4)缓冲区大小及限制
- The Euler function(hdu2824,欧拉函数)
- 编写自己的头文件与C++中的c库
- Web App开发入门
- 杭电2043密码
- android使用笔记 持续更新中。。。
- 【iOS开发】关于xib文件的运用与封装
- 为PopupWindow设置动画
- [HiHoCoder]#1066 : 无间道之并查集
- unity笔记
- Java多线程与单线程性能对比
- 去哪儿网2015春季校招笔试--回忆版
- RunLoop