现在的位置: 首页 > 综合 > 正文

hdu 2024

2018年04月23日 ⁄ 综合 ⁄ 共 356字 ⁄ 字号 评论关闭

背景:水。主要是#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;
}

抱歉!评论已关闭.