acm2024
/**
* 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的更多相关文章
随机推荐
- MC34063A development aid
http://www.nomad.ee/micros/mc34063a/index.shtml This is a simple-minded design tool that allows you ...
- SEEprog Serial EEPROM programmer
Features SEEprog is universal programmer of all types of serial EEPROMs in 8-pin package. SEEprog en ...
- [Node.js]OS模块
摘要 Node.js有很多工具模块,比如os,path,net,dns,domain模块.这里先介绍os模块的使用方法.os模块提供了一些基本的系统操作函数. os模块 引入os模块 var os=r ...
- Adding an instance to a MEF container
How can you add an already created instance to a MEF container/cataloge to use when resolving Import ...
- Bootstrap 3之美02-Grid简介和应用
本篇主要包括: ■ Grid简介■ 应用Grid■ Multiple Grids Grid简介 Bootstrap中,把页面分成12等份,这就是所谓的Grid. 在Bootstrap中,用类名控 ...
- leetcode第一刷_Gray Code
说到格雷码,应该没人不知道,详细它有什么用,我还真不是非常清楚,我室友应该是专家.生成的规律不是非常明显,之前看到帖子讲的,这会儿找找不到了.. 思想是这种,假设有n位,在第2^(n-1)个编码以下画 ...
- pytest文档19-doctest测试框架
前言 doctest从字面意思上看,那就是文档测试.doctest是python里面自带的一个模块,它实际上是单元测试的一种. 官方解释:doctest 模块会搜索那些看起来像交互式会话的 Pytho ...
- 如何中断正在执行IO的 Quartz 作业
Interrupt a Quartz job that doing IO 如果你想中断正在执行IO的 Quartz 作业,在你使用 InterruptibleChannel 时这是可行的.引用一下Or ...
- java.lang.UnsatisfiedLinkError:no dll in java.library.path终极解决之道
Java调用Dll时,会出现no dll in java.library.path异常,在Java Project中不常见,因为只要将Dll拷贝到system32目录下即可: 但若是 ...
- 解决hue报错:timed out (code THRIFTSOCKET): None
报错栈: [/Jun/ :: +] decorators ERROR error running <function execute at 0x7fba2804ecf8> Tracebac ...