#include <iostream>
#include <string> using namespace std; bool judgeSize(string str)
{
int size = str.size();
if (size < || size>)
return false;
return true;
} int isA(string str)
{
for (auto &c : str)
{
if (c >= 'A' && c <= 'Z')
return ;
}
return ;
}
int isa(string str)
{
for (auto &c : str)
{
if (c >= 'a' && c <= 'z')
return ;
}
return ;
}
int is0(string str)
{
for (auto &c : str)
{
if (c >= '' && c <= '')
return ;
}
return ;
}
int isOther(string str)
{
for (auto &c : str)
{
if (c == '~' || c == '!' || c == '@' || c == '#' || c == '$' || c == '%' || c == '^')
return ; }
return ;
}
int main()
{
int M;
string str;
while (cin >> M)
{
while (M--)
{
cin >> str;
if (judgeSize(str))
{
int judge = isA(str) + isa(str) + is0(str) + isOther(str);
if (judge >= )
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl;
}
}
else
{
cout << "NO" << endl;
}
}
}
}

hdoj:2043的更多相关文章

  1. 算法——A*——HDOJ:1813

    Escape from Tetris Time Limit: 12000/4000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  2. hdoj:题目分类

    基础题: 1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029.1032.1037.1040.1048.1056.1058. ...

  3. HDOJ:1533-Going Home(最小费用流)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1533 解题心得: 第一次写最小费用流的题,去hdoj上找了一个入门级题目,建图比较简单,用了spfa和 ...

  4. hdoj:2086

    A1 = ? Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Subm ...

  5. hdoj:2085

    核反应堆 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  6. hdoj:2084

    数塔 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submissi ...

  7. HDOJ:6333-Problem B. Harvest of Apples(组合数学+莫队算法+逆元)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6333 解题心得: 这个题可以说是十分精彩了,首先推组合数学的公式,其中一个很重要的公式是Cnm = C ...

  8. HDOJ:6356-Glad You Came(线段树剪枝)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6356 解题心得: 现在深深的知道了算法复杂度的重要了,这个题算复杂度的时候还要把一些常数也算出来,不然 ...

  9. hdoj:2075

    A|B? Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

随机推荐

  1. android 按钮特效 波纹 Android button effects ripple

    android 按钮特效 波纹 Android button effects ripple 作者:韩梦飞沙 Author:han_meng_fei_sha 邮箱:313134555@qq.com E- ...

  2. Sphinx(coreseek)一些记录

    之前用Sphinx(coreseek)几次,相对正常 这次用到,记录些问题 1.coreseek好像没人维护了吗,有点可惜. 2.centOS7 编译和coreseek版本有点问题,需要修改编译文件 ...

  3. boostrap常用的类

    1.col-md-push-3  :向右移动3 2.col-md-pull -9 : 向左移动9 3.clearfix: 清除元素浮动问题 4. col-md-offset-3: 向右偏移 5.pul ...

  4. React系列文章:JSX生成真实DOM结点

    在上一篇文章中,我们介绍了Babel是如何将JSX代码编译成可执行代码的,随后也实现了一个自己的解析器,模拟了Babel编译的过程. 现在我们再来回顾一下,假定有如下业务代码: const style ...

  5. php integer

    一.整数的表示方法: 整型值可以使用十进制,十六进制,八进制或二进制表示,前面可以加上可选的符号(- 或者 +) 要使用二进制表达,数字前必须加上 0b 要使用八进制表达,数字前必须加上 0. 要使用 ...

  6. oracle中的decode的使用(转)

    地址:http://www.cnblogs.com/juddhu/archive/2012/03/07/2383101.html 含义解释:decode(条件,值1,返回值1,值2,返回值2,...值 ...

  7. Oracle 拼接列数据的方法

    select wm_concat(fphone) phone from dq_phone_ndtbdxz wm_concat(列名):把多列值,合并成一列,用,隔开.

  8. Java中使用Timer和TimerTask实现多线程

    转自:http://www.bdqn.cn/news/201305/9303.shtml 摘要:Timer是一种线程设施,用于安排以后在后台线程中执行的任务.可安排任务执行一次,或者定期重复执行,可以 ...

  9. __Linux__文件和目录

    Linux 目录 /:根目录,一般根目录下只存放目录,在Linux下有且只有一个根目录.所有的东西都是从这里开始.当你在终端里输入“/home”,你其实是在告诉电脑,先从/(根目录)开始,再进入到ho ...

  10. SpringMVC默认欢迎页面的问题

    使用SpringMVC很长时间,一直有个问题没有搞定,就是web.xml中默认欢迎页面转向控制器的问题. 由于答应朋友明天要交个网站,他们对默认页面有这样的要求,并且最好也别用js等等的跳转:所以今天 ...