码迷,mamicode.com
首页 > 其他好文 > 详细

hdu 2024

时间:2015-03-09 22:28:09      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:

背景:水。主要是#include<cctype>还忘了
#include<cstdio>
#include<iostream>
#include<cctype>
using namespace std;

int main(void){
    int t;
    scanf("%d",&t);
    while(t--){
        bool ok=true;
        for(int i=0;;i++){
            char c=getchar();
            if(i == 0){
                if(c != '_' && !isalpha(c)) ok=false;
            }else{
                if(isdigit(c) || isalpha(c) || c == '_');
                else if(c == '\n') break;
                else{
                    ok=false;
                }
            }
        }
        if(ok) printf("yes\n");
        else printf("no\n");
    }
    return 0;
}


hdu 2024

标签:

原文地址:http://blog.csdn.net/jibancanyang/article/details/44161553

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!