杭电ACM2024 //成长日记

#include
int main()
{
	char s[105];
	int n,i;
	bool flag;
	scanf("%d ",&n);
	while(n--)
	{
		flag=true;
		gets(s);
		if(s[0]=='_' || (s[0]<='z' && s[0]>='a') || (s[0]<='Z' && s[0]>='A') )
		{
			for(i=1;s[i];i++)
			{
				if((s[i]>='a' && s[i]<='z')||(s[i]>='A' && s[i]<='Z')|| s[i]=='_' || (s[i]>='0' && s[i]<='9'))
				flag=true;
				else
				{
					flag=false;
					break;
				}
			}
			if(flag==true)printf("yes\n");
			else printf("no\n");
		}
		else 
		{
			printf("no\n");
		}
	}
	return 0;
}

 

你可能感兴趣的:(ACM基础篇(HDU,FAFU))