/**

 * C语言合法标识符

 */

import java.util.*;

public class acm2024 {



public static void main(String[] args) {

Scanner in = new Scanner(System.in);

int n = in.nextInt();

in.nextLine();

while (n--!= 0) {

String str = in.nextLine();

char[] chs = str.toCharArray();

//Character.isLetter(chs[0])确定指定字符是否为字母

if (!(Character.isLetter(chs[0]) || chs[0] == '_')) {

System.out.println("no");

continue;

}

boolean flag = true;

for (int i = 1; i < chs.length; i++) {

//Character.isDigit(chs[i])确定指定字符是否为数字
Character.isLetter(chs[i])确定指定字符是否为字母

if (!(Character.isDigit(chs[i]) || Character.isLetter(chs[i]) || chs[i] == '_')) {

flag = false;

break;

}

}

if(flag)

System.out.println("yes");

else

System.out.println("no");

}

}

}

acm2024的更多相关文章

随机推荐

  1. Python学习笔记(二):条件控制语句与循环语句及常用函数的用法

    总结的内容: 1.条件控制语句 2.while循环语句 3.for循环语句 4.函数的用法 一.条件控制语句 1.介绍 Python条件语句是通过一条或多条语句的执行结果(True或者False)来决 ...

  2. 读书笔记_Effective_C++_条款三十三:避免遮掩继承而来的名称

    名称的遮掩可以分成变量的遮掩与函数的遮掩两类,本质都是名字的查找方式导致的,当编译器要去查找一个名字时,它一旦找到一个相符的名字,就不会再往下去找了,因此遮掩本质上是优先查找哪个名字的问题. 而查找是 ...

  3. php在linux后台执行

    <?php ignore_user_abort();//后台运行 ini_set('default_socket_timeout', -1);//socket不超时 set_time_limit ...

  4. Android自己定义组件系列【3】——自己定义ViewGroup实现側滑

    有关自己定义ViewGroup的文章已经非常多了,我为什么写这篇文章,对于刚開始学习的人或者对自己定义组件比較生疏的朋友尽管能够拿来主义的用了,可是要一步一步的实现和了解当中的过程和原理才干真真脱离别 ...

  5. USB Mass Storage大容量存储 The Thirteen Class章节的理解

    http://blog.csdn.net/xgbing/article/details/7002558 USB Mass Storage 6.7 The Thirteen Class章节的理解 Cas ...

  6. How to Find Processlist Thread id in gdb !!!!!GDB 使用

    https://mysqlentomologist.blogspot.jp/2017/07/           Saturday, July 29, 2017 How to Find Process ...

  7. mysql查询null异常:attempted to return null from a method with a primitive return type

    select sum(deposit_amount)from tb_commission_ib_day mysql查询时报异常: attempted to return null from a met ...

  8. no scheme 问题

    用xcode4打开xcode3建立的工程,有时候,不能自动转换版本,就会显示no scheme. 这个是由于XXX..xcodeproj包中xcuserdata文件夹中user.xcuserdatad ...

  9. android中PopupMenu的使用

    PopupMenu可以非常方便的在指定view的下面显示一个弹出菜单,类似于actionbar溢出菜单的效果.它的菜单选项可以来自于menu资源,因此非常方便.下面是在网上找的一个PopupMenu的 ...

  10. 配置quartz数据源的三种方式

    如果是使用了JDBC JobStore或JobStoreCMT获得持久的Job时,就要配置相关的数据源了. 方式一:使用quartz.properties文件,这时只需要在property文件中增加如 ...