semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	int n,i,j,l,t;
	char a[81];
	cin>>n;
	cin.getline(a,81);
	for(i=1;i<=n;i++){
		cin.getline(a,81);
		l=strlen(a);
		if(a[0]=='_'||(a[0]>='A'&&a[0]<='Z')||(a[0]>='a'&&a[0]<='z')){
			t=1;
			for(j=1;j<l;j++){
				if(a[j]=='_'||(a[j]>='A'&&a[j]<='Z')||(a[j]>='a'&&a[j]<='z')||(a[j]>='0'&&a[j]<='9'))
					t=1;
				else {
					t=0;
					break;
				}
			}
		}
		else t=0;
		cout<<t<<endl;
	}
	return 0;
}
/*
 * 1000010175_325.cpp
 *
 *  Created on: 2010-11-26
 *      Author: ???
 *      function:  ?????C????????
 */



int main(){
	char str[100];
	int i,n,ilen;
	cin>>n;
	cin.getline(str,100);  //??????'\n'
	while(n>0)
	{
		cin.getline(str,100);
		ilen=strlen(str);
		i=1;
		if((str[0]>='a'&&str[0]<='z')||(str[0]>='A'&&str[0]<='Z')||(str[0]=='_'))  //?????????????
			for(;i<ilen;i++)
				if((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z')||(str[i]=='_')||(str[i]>='0'&&str[i]<='9'))  //????????
					continue;
				else
					break;
		if(i==ilen)
			cout<<1<<endl;
		else
			cout<<0<<endl;
		n--;
	}
	return 0;
}
int main(){
  int n,i;
  char *p;
  scanf("%d\n",&n);
  char s[n][81];
  for(i=0;i<n;i++)
    gets(s[i]);
  for(i=0;i<n;i++){
    int a=1;
    p=s[i];
    if(*p>=65&&*p<=90||*p==95||*p>=95&&*p<=122){
      p++;
      while(*p!=0){
        if(*p<48||*p>57&&*p<65||*p>90&&*p!=95&&*p<95||*p>122){
          a=0;
          break;
          }
        p++;
        }
      }
    else
      a=0;
    printf("%d\n",a);
    }
   
  }
//C???????????????????????????????????? 
//????????????n????????????C???????????????1??????0


int main ()
{
	int n, i, j, k, len;
	char str[100][81];
	
	cin >> n;
	cin.get();
	for(i = 0; i < n ; i ++)
	{
		cin.getline(str[i], 81);
	}
	for( j = 0; j < n; j ++)
	{
		len = strlen(str[j]);
		if((str[j][0] >='a'&&str[j][0]<='z') ||(str[j][0] == '_')||(str[j][0]>='A'&&str[j][0]<='Z'))
		{
			for( k = 1; k < len ; k ++)
			{
				if((str[j][k] >='a'&&str[j][k] <='z')||(str[j][k]>='A'&&str[j][k]<='Z')||(str[j][k] >='0'&&str[j][k]<='9')||(str[j][k]=='_'))
					;
				else
					break;
				
			}
			if(k == len)
				cout<<'1'<<endl;
			else
				cout<<'0'<<endl;
		}
		else
			cout <<'0'<<endl;
	}
	
	return 0;
}
void main()
{
	int i,j,n,t=0;
	char (*str)[81],p[2];
	scanf("%d",&n);
	gets(p);
	str=(char (*)[81])malloc(n*sizeof(char)*81);
	for(i=0;i<n;i++)
		gets(*(str+i));
	for(i=0;i<n;i++)
	{
		t=0;
		if(**(str+i)>='a'&&**(str+i)<='z'||**(str+i)>='A'&&**(str+i)<='Z'||**(str+i)=='_')
		{
			for(j=1;*(*(str+i)+j)!='\0';j++)
			{
				if(!(*(*(str+i)+j)>='a'&&*(*(str+i)+j)<='z'||*(*(str+i)+j)>='A'&&*(*(str+i)+j)<='Z'||*(*(str+i)+j)=='_'||*(*(str+i)+j)>='0'&&*(*(str+i)+j)<='9')){printf("0\n");t=1;break;}
			}
			if(t==0)printf("1\n");
		}
		else printf("0\n");
	}
}
int main()
{
	char ch[100];
	char q;
	int n,i,l,k,r,t;
	int a[100];
	scanf("%d",&n);
	gets(ch);
	for(i=1;i<=n;i++)
	{
		
		gets(ch);
		r=strlen(ch);
		l=ch[0];
		if((l>=65&&l<=90)||(l==95)||(l<=122&&l>=97))
		{a[i-1]=1;}
		else {a[i-1]=0;}
	 for(t=1;t<=r-1;t++)
	{
		if((ch[t]<=64&&ch[t]>=58)||(ch[t]>=91&&ch[t]<=94)||(ch[t]==96)||(ch[t]>=123)||(ch[t]<=47))
		{a[i-1]=0;}

	}
	   
	
	}
   for(k=1;k<=n;k++)
   {
	   printf("%d\n",a[k-1]);
   }
   return 0;
}
void main()
{
	int n,i,j,l,flag;
	scanf("%d",&n);
	getchar();
	char a[100];
	for(i=0;i<n;i++)
	{
		flag=1;
		gets(a);
		l=strlen(a);
		if(!(a[0]=='_'||(a[0]>='a'&&a[0]<='z')||(a[0]>='A'&&a[0]<='Z')))
			flag=0;
		else
		{
			for(j=1;j<l;j++)
			{
			    if(!(a[j]=='_'||(a[j]>='a'&&a[j]<='z')||(a[j]>='A'&&a[j]<='Z')||(a[j]>='0'&&a[j]<='9')))
				{
					flag=0;
					break;
				}
				else
					flag=1;
			}
		}
		if(flag==0) printf("0\n");
		else printf("1\n");
	}
}
// asdddee.cpp : Defines the entry point for the console application.
//




int main()
{ char zifu[100];
   char a[10];
   int n,p,i,j,l;
      gets(a);
       n=atoi(a); 
        for(i=0;i<n;i++){
             gets(zifu);
                 if(zifu[0]=='_'||(zifu[0]>='A'&&zifu[0]<='Z')||(zifu[0]>='a'&&zifu[0]<='z'))
				 {   l=1;
				         p=1;
                               for(j=1;zifu[j]!='\0';j++){
                                      if((zifu[j]>='A'&&zifu[j]<='Z')||(zifu[j]>='a'&&zifu[j]<='z')||(zifu[j]>='0'&&zifu[j]<='9')||zifu[j]=='_') 
                                          p=1;
                                             else{
                                                p=0;
                                                    break;}                  
                                                        } 
                                                                   
                               }
                 else 
					 l=0;
				 if(l==0)
                      printf("0\n");
                            else if(p==1&&l==1)
                                          printf("1\n");
							                   else if(p==0)
												   printf("0\n");
                        }
  

  	
  return 0;
}
main()
{
   int n,i,j,m=0;
   int b[100];
   scanf("%d\n",&n);
   char a[100][100];
   for(i=0;i<n;i++)
   {
      gets(a[i]);
      b[i]=strlen(a[i]);
   }
   for(i=0;i<n;i++)
   {
       for(j=0;a[i][j]!='\0';j++)
	    	if((a[i][j]>=48&&a[i][j]<=57)||(a[i][j]>=65&&a[i][j]<=90)||(a[i][j]>=97&&a[i][j]<=122)||(a[i][j]=='_'))
				m++;
	   if((m==b[i])&&((a[i][0]>=65&&a[i][0]<=90)||(a[i][0]>=97&&a[i][0]<=122)||(a[i][0]=='_')))
            printf("1\n");
       else
            printf("0\n");
	   m=0;
   }
}
int main()
{int n,i,j,b[100][80]={0},c[100]={0},l;
char a[100][80];
scanf("%d",&n);
getchar();
for(i=0;i<n;i++)
 {gets(a[i]);
  c[i]=strlen(a[i]);
  for(j=0;j<c[i];j++)
  b[i][j]=a[i][j];
  l=1;
  if((b[i][0]>=65&&b[i][0]<=90)||(b[i][0]>=97&&b[i][0]<=122)||b[i][0]==95)
  {
   for(j=1;j<c[i];j++)
   {if((b[i][j]>=65&&b[i][j]<=90)||(b[i][j]>=97&&b[i][j]<=122)||(b[i][j]>=48&&b[i][j]<=57)||b[i][j]==95)
     l++;}
    if(l==c[i])
    printf("1\n");
    else printf("0\n");}
  else printf("0\n");}
 return 0;
}
int main()
{
	char*p;
	int n,i,j,k;
	int*q;
	scanf("%d\n",&n);
	q=(int*)malloc(n*sizeof(int));
	for(i=0;i<n;i++)
	{
		p=(char*)malloc(80*sizeof(char));
		gets(p);
		for(j=0;*(p+j)!='\0';j++)
		{
			if(*(p+j)=='_'||(*(p+j)>='A'&&*(p+j)<='Z')||(*(p+j)>='a'&&*(p+j)<='z')||(*(p+j)>='0')&&(*(p+j)<='9'))
			{
				k=1;
			}
			else
			{
				k=0;
				break;
			}
		}
		if((*p=='_'||(*p>='A'&&*p<='Z')||(*p>='a'&&*p<='z'))&&(k==1))
		{
			*(q+i)=1;
		}
		else
		{
			*(q+i)=0;
		}
	}
	printf("%d",*q);
	for(i=1;i<n;i++)
	{
		printf("\n%d",*(q+i));
	}
}
int main()
{
	int f(char *str);
	int n,i,p;
	char str[100][100],*t;
	scanf("%d\n",&n);
	for(i=0;i<n;i++)
	{
		gets(str[i]);
	}
	for(i=0;i<n;i++)
	{
		t=str[i];
		p=f(t);
		printf("%d\n",p);
	}
	return 0;
}
int f(char *str)
{
	int p=1,i=0;
	if(*str=='_' || (*str>='A' && *str<='Z')||(*(str+i)>='a' && *(str+i)<='z'))
		p=1;
	else
		p=0;
	for(i=1;*(str+i)!='\0';i++)
	{
		if((*(str+i)>=48 && *(str+i)<=57)||(*(str+i)>='A' && *(str+i)<='Z')||(*(str+i)>='a' && *(str+i)<='z')||*(str+i)=='_')
			p=p;
		else
		{
			p=0;
			break;
		}
	}
	return p;
}
int  main(){    
	int n;    
	cin >> n;
    char s1[5];
	cin.getline(s1,5);
	while (n)
	{
		int tem=1;
		char s[90];
		cin.getline(s,90);
		int i;
        for (i=0;i<strlen(s);i++)
		{
			if (i==0)
				if (s[0]=='_'||(s[0]>='a'&&s[0]<='z')||(s[0]>='A'&&s[0]<='Z'))
					tem=1;
				else 
				{
					tem=0;
					break;
				}
			else
				if (s[i]>='a'&&s[i]<='z'||(s[i]>='A'&&s[i]<='Z')||s[i]>='0'&&s[i]<='9'||s[i]=='_')
					tem=1;
				else 
				{
					tem=0;
					break;
				}
		}
	cout << tem<< endl;   
	n--;
	}
		return 0;
}
int main()
{
    int i,n,j,k,p,b[100];
    char m[100],l[1];
    cin>>n;
    cin.getline(l,1);
    int han(char m[]);
    for(k=0;k<n;k++)
    {
        cin.getline(m,100);
        b[k]=han(m);
       //cout<<han(m)<<endl;
    }
    for(k=0;k<n;k++) cout<<b[k]<<endl;

    return 0;
}
int han(char m[])
{
   int i,p=1;

    if((m[0]>=65&&m[0]<=97)||(m[0]>=97&&m[0]<=122)||m[0]==95)
        {
            for(i=1;i<strlen(m);i++)
            if((m[i]>=65&&m[i]<=97)||(m[i]>=97&&m[i]<=122)||m[i]==95||(m[i]>=48&&m[i]<=57))
             p++;
        }
        if(p==strlen(m)) return 1;
        else return 0;
}
int main()
{
	int i,j,k,n;//??????ij???k?????n
	char a[81];//????a
	cin>>n;
	cin.getline(a,81);
	for(i=1;i<=n;i++)
	{
		k=1;
		cin.getline(a,81);//??
		if((a[0]>47)&&(a[0]<58))
			k=0;
		for(j=0;j<strlen(a);j++)
		{
			if(((a[j]>64)&&(a[j]<91))||((a[j]>96)&&(a[j]<123))||a[j]=='_'||((a[j]>47)&&(a[j]<58)))
				continue;
			k=0;//???????????
		}
		cout<<k<<endl;//??
	}
	return 0;
}
main()
{
int i;
int n;
scanf("%d\n",&n);
for(i=0;i<n;i++)
{
 char a[81];
gets(a);
int j,k,L;
L=0;
if(a[0]=='_'||(a[0]>='a'&&a[0]<='z')||(a[0]>='A'&&a[0]<='Z'))   
  {
      for(j=0;a[j]!='\0';j++)
       { 
         if(a[j]=='_'||(a[j]>='a'&&a[j]<='z')||(a[j]>='A'&&a[j]<='Z')||(a[j]>='0'&&a[j]<='9'))
          continue;
          else
          {L++;break;}
       }
       if(L!=0)
       printf("0\n");
       else
       printf("1\n");
  }   
else
printf("0\n");
}
}
main()
{
    int i,j,n;
    char s[81];
    scanf("%d\n",&n);
    for(i=0;i<n;i++)
    {
        gets(s);
        for(j=0;s[j]!='\0';j++)
        {
            if((s[j]=='_')||(s[j]>='A'&&s[j]<='Z')||(s[j]>='a'&&s[j]<='z')||(s[j]>='0'&&s[j]<='9'&&j>0))
            {;}
            else
            break;
        }
        if(s[j])
        printf("0\n");
        else
        printf("1\n");
    }
}
/*
 * 3.cpp
 *
 *  Created on: 2010-11-20
 *      Author: jsgl
 */

int main(){
	int n;
	cin>>n;
	for(int i=0;i<=n;i++){
		char a[81];int t=1;
		gets(a);//????
		int l=strlen(a);
		if(i!=0){
		if(!(a[0]==95||(a[0]>=97&&a[0]<=122)||(a[0]>=65&&a[0]<=90)))t=0;//???????????????
		for(int j=1;j<l;j++){
			if(!((a[j]>='a'&&a[j]<='z')||(a[j]>='A'&&a[j]<='Z')||(a[j]>='0'&&a[j]<='9')||a[j]=='_'))//???????
				t=0;
		}cout<<t<<endl;//?????????1????????0???
	}}return 0;
}
int panduan(char i,int k)
{
        if((i>='a'&&i<='z')||(i>='A'&&i<='Z')||(i>='0'&&i<='9')||i=='_')
        return k;
        else
        return 0;
}
main()
{
    int n;
    scanf("%d",&n);
    int i=0,k=1;
    char a[100];
    for(i=0;i<=n;i++)
    {
        gets(a);
        if(i==0)
        continue;
        if((a[0]>='a'&&a[0]<='z')||(a[0]>='A'&&a[0]<='Z')||a[0]=='_')
        {
             for(int j=0;a[j]!='\0';j++)
             {
                 k=panduan(a[j],k);
             }
             if(k==1)
             printf("1\n");
             else
             printf("0\n");
             k=1;
        }
        else
        printf("0\n");
    }
    return 0;
}
int main()
{
	int n;
		int k;
			char a[81];
			scanf("%d",&n);
			getchar();
	for(int i=0;i<n;i++)
	{
        k=1;
		gets(a);
		if(a[0]<='9'&&a[0]>='0')
		{
			printf("%d\n",k-1);
			continue;
		}
		for(int j=0;a[j]!='\0';j++)
		{
			if((a[j]<='z'&&a[j]>='a')||(a[j]<='Z'&&a[j]>='A')||(a[j]=='_')||(a[j]<='9'&&a[j]>='0'))
			{}
			else
			{
				k--;
				printf("%d\n",k);
				break;
			}

		}
        if(k==1)
		printf("%d\n",k);
	}
	return 0;
}
int main()
{
	int n, i, j, n1;
	char str[200];
	cin >> n;
	cin.get();
	for (i = 1; i <= n; i++)
	{
		j = 1;
		cin.getline(str,120);
		if (!((str[0] == '_') || ((str[0] >= 'a') && (str[0] <= 'z')) || ((str[0] >= 'A') && (str[0] <= 'Z'))))
		{
			cout << 0 << endl;
			continue;
		}
		for (j = 1; str[j] != 0; j++)
		{
			if (((str[j] >= 'a') && (str[j] <= 'z')) || ((str[j] >= '0') && (str[j] <= '9')) || (str[j] == '_') || ((str[j] >= 'A') && (str[j] <= 'Z')))
				continue;
			else
				break;
		}
		if (str[j] == 0)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}

	return 0;
}
main()
{
      int i,j,n,flag=1;
      char **p;
      scanf("%d\n",&n);
      p=(char **)malloc(n*sizeof(char *));
      for(i=0;i<n;i++)
      {
           p[i]=(char *)malloc(81*sizeof(char));           
      }
      for(i=0;i<n;i++)
      {
           gets(p[i]);           
      }
      for(i=0;i<n;i++)
      {
           if(!(p[i][0]=='_'||(p[i][0]>='a'&&p[i][0]<='z')||(p[i][0]>='A'&&p[i][0]<='Z')))                    
                       flag=0;
           for(j=0;p[i][j]!='\0';j++)
           {
                if(!((p[i][j]>='0'&&p[i][j]<='9')||(p[i][j]>='a'&&p[i][j]<='z')||(p[i][j]<='Z'&&p[i][j]>='A')||(p[i][j]=='_'))) 
                       flag=0; 
           }
           printf("%d\n",flag);
           flag=1;           
      }
      for(i=0;i<n;i++)
           free(p[i]);
      free(p);
     
}
int main()
{
	char string[81];
	int n,i,j,flag;
	cin>>n;
	cin.get();
	for (i=1;i<=n;i++)
	{
		flag=0;
		gets(string);
		char x=string[0];
		if ( (x<65) ||(x>90&&x<95) || (x==96) || (x>122) )
			{ flag=1;}
		for (j=1;string[j]!='\0';j++)
		{
			x=string[j];
			if ( (x<48) || (x>57&&x<65) ||(x>90&&x<95) || (x==96) || (x>122) )
				{ flag=1;break;}
		}
		if (i!=1) cout<<endl;
		if (flag==1) cout<<0;
		else cout<<1;
	}
	return 0;
}
/*
 * ?????????C????????
 * ??? ???
 * ????: 2010-11-26
 * ????????C????????
 */



int main(){
	char str[81];	//???
	int n, i=0;
	cin >> n;
	cin.getline(str, 81);	//?????'\n'
	while(i<n){
		cin.getline(str, 81);
		if(str[0]=='_' || (str[0]>='A'&&str[0]<='Z')	//????????
			|| (str[0]>='a'&&str[0]<='z')){
			int len = strlen(str), j;
			for(j=1; j<len; j++){						//??????????
				if(str[j]!='_' && (str[j]<'A'||str[j]>'Z')
						&& (str[j]<'a'||str[j]>'z') && (str[j]<'0'||str[j]>'9'))
					break;
			}
			if(j==len) {cout << 1 << endl; i++; continue;}	//??????????????1
		}
		cout << 0 << endl;		//????0
		i++;
	}
	return 0;
}
int main()
{
	int k;
	char input[81];
	cin >>k;
	cin.get();
	while (k>0)
	{
		cin.getline(input,81);
		int i=1,leg=0;
	    if (input[0]=='_'||(input[0]>='a'&&input[0]<='z')||(input[0]>='A'&&input[0]<='Z'))
	      leg=1;
	    while (input[i]!=0)
	    {
		  if (leg==0) break;
		  else if ((input[i]>='a'&&input[i]<='z')||(input[i]>='A'&&input[i]<='Z')||(input[i]>='0'&&input[i]<='9')||input[i]=='_')
		        leg=1;
		  else leg=0;
		  i++;
	    }
		cout <<leg <<endl;
		k--;
	}

	return 0;
}
int main()
{
int f(char a[],int t);
int n,i,p,m;
char a[100];
scanf("%d\n",&n);
for(i=1;i<=n;i++)
{
	gets(a);
	m=strlen(a);
	p=f(a,m);
	printf("%d\n",p);
}
}
int f(char a[],int t)
{
	int c=1,l;
	for(l=1;l<=t-1;l++)
	{
		if((a[l]!='_')&&(!((a[l]>=48&&a[l]<=57)||(a[l]>=65&&a[l]<=90)||(a[l]>=97&&a[l]<=122)))){c=0;break;}
	}
    if((c==1)&&(a[0]=='_'||((a[0]>=65&&a[0]<=90)||(a[0]>=97&&a[0]<=122))))c=1;
    else c=0;
	return(c);
}
int main()
{
	int case_num;
	int i;
	int length;
	int result;
	char identifier[90];
	scanf("%d", &case_num);
	gets(identifier);
	while(case_num --) {
		gets(identifier);
		length = strlen(identifier);
		result = 1;
		if (length == 0 ||!(identifier[0] == '_' || isalpha((int)identifier[0])))
			result = 0;
		for (i = 1; i < length; i ++) {
			if (!(identifier[i] == '_' || isalpha((int)identifier[i]) || isdigit((int)identifier[i])))
				result = 0;
		}
		printf("%d\n", result);
	}
	return 0;
}
int main()
{
	int n;
	char line[100];
	int i;

	cin>>n;
	cin.get();

	while(n--)
	{
		cin.getline(line,100);
		if(line[0]!='_' && (line[0]>'z'||line[0]<'a')&&(line[0]>'Z'||line[0]<'A'))
		{
			cout<<"0"<<endl;
			continue;
		}
	//	cout<<"line="<<line<<endl;
		int len=strlen(line);
		for(i=1;i<len;i++)
		{
			if(line[i]!='_' && (line[i]>'z'||line[i]<'a')&&(line[i]>'Z'||line[i]<'A')&&(line[i]<'0'||line[i]>'9'))
			{
				cout<<"0"<<endl;
				break;
			}
		}
		if(i==len)
			cout<<"1"<<endl;
	}
	return 0;
}
int main()
{	int n,len,i,j,count;
	int a=1,b=0;
	char *p;
	char zfc[81];
	scanf("%d",&n);
	getchar();
	for(i=0;i<n;i++){
		count=0;
		gets(zfc);
		len=strlen(zfc);
		p=zfc;
		if(*p=='_'||(*p>='A'&&*p<='z')){
			for(p=zfc+1;p<zfc+len;p++){
				if(*p!='_'&&(*p<'0'||(*p>'9'&&*p<'A')||*p>'z')){
					printf("%d\n",b);
					break;
				}
				count++;
			}
			if(count==len-1)
				printf("%d\n",a);
		}
		else
			printf("%d\n",b);
	}
	return 0;
}
int check(char a[100])
      {
          int t=strlen(a),i,j=1;
          if((a[0]>='a'&&a[0]<='z')||(a[0]=='_'))
          {
                                                 if(t==1)return 1;
                                                 for(i=1;i<t;i++)
                                                 if((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')||(a[i]>='0'&&a[i]<='9')||(a[i]=='_'))
                                                 j++;}
                                                 else if(a[0]>='A'&&a[0]<='Z')
                                                 {
                                                      if(t==1)return 1;
                                                      for(i=1;i<t;i++)
                                                      if((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')||(a[i]>='0'&&a[i]<='9')||(a[i]=='_'))
                                                      j++;}
                                                      else return 0;
                                                      if(j==i)return 1;
                                                      else return 0;
                                                                
             }
      main()
      {
      int n,i;
      char a[100];
      scanf("%d",&n);
      gets(a);
      for(i=0;i<n;i++)
      {
                      gets(a);
                      int k=check(a);
                      printf("%d\n",k);
      }      
      getchar();
      getchar();
      getchar();
      }
int main()
{
	int n, i = 1, flag = 0;
	cin >> n;
	cin.get();
	char sen[100];
	while ( cin.getline(sen, 100) )
	{
		flag = 0;
		i = 1;
		if ( sen[0] !='_' && (sen[0] < 'a' || sen[0] >'z') && ( sen[0] <'A' || sen[0] >'Z'))
		{
			cout << 0 << endl;
			flag = 1;
			continue;
		}
		else
		{
			while( sen[i] !='\0') 
			{
				if ( sen[i] !='_' && (sen[i] < 'a' || sen[i] >'z') && ( sen[i] <'A' || sen[i] >'Z') && ( sen[i] <'0' || sen[i] >'9'))
				{
					cout << 0 << endl;
					flag = 1;
					break;
				}
				i ++;
			}
			if ( flag == 0 )
				cout << 1 << endl;
		}
	}
	return 0;
}
int main()
{
      int n;
      scanf("%d\n",&n);
      int i,judge,l,j;
      char s[100];
      for (i=0;i<n;i++)
      {
          gets(s);
          judge=1;
          if (s[0]<'A'||s[0]>'Z')
            if (s[0]<'a'||s[0]>'z')
              if (s[0]!='_')
                judge=0;
          l=strlen(s);
          for (j=0;j<l;j++)
          {
              if (s[j]<'A'||s[j]>'Z')
                 if (s[j]<'a'||s[j]>'z')
                    if (s[j]<'0'||s[j]>'9')
                       if (s[j]!='_')
                       {   
                           judge=0;
                       }
          }
          printf("%d\n",judge);
      }
}
char a[80];
int main()
{
   int n,i,j;
   int OK;
   cin>>n;
   cin.get();
   for(i=0;i<n;i++)
        {
         cin.getline(a,81);
         OK=0;
		 if( (a[0]=='_') || ((a[0]-'A'>=0)&&(a[0]-'A'<=25)) || ((a[0]-'a'>=0)&&(a[0]-'a'<=25)) )
                 {for(j=0;j<80;j++)
				       {if(a[j]=='\0')break;
		                if(!( (a[j]=='_') || ((a[j]-'A'>=0)&&(a[j]-'A'<=25)) || ((a[j]-'a'>=0)&&(a[j]-'a'<=25)) || ((a[j]-'0'>=0)&&(a[j]-'0'<=9))))
						{cout<<0<<endl;OK=1;break;}}
		         if(OK==0)cout<<1<<endl;}
		 else cout<<0<<endl;
         }
   return 0;
}
int judge;
char zfc[81];

void judge1(char *p);
void judge1(char *p)
{
	if(!((*p>64&&*p<91)||(*p>96&&*p<123)||*p==95))
	{judge=0;}
	return;
}

void judge2(char *p);
void judge2(char *p)
{
	int len;
	len=strlen(zfc);
	int i;
	for(i=0;i<len;i++)
	{
		if(!((*(p+i)>64&&*(p+i)<91)||(*(p+i)>96&&*(p+i)<123)||*(p+i)==95||(*(p+i)>47&&*(p+i)<58)))
		{
			judge=0;
			break;
		}
	}
	return;
}

int main()
{
	int num;
	scanf("%d",&num);

	int i;
	char (*p)[30];
	for(i=0;i<num;i++)
	{
		judge=1;
		if(i==0)
		{getchar();}
		gets(zfc);
		p=&zfc;
		judge1(*p);
		judge2(*p);
		if(judge==0)
		{
			printf("0\n");
		}
		if(judge==1)
		{
			printf("1\n");
		}	
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int n,i,k;
	char string[81];
	char *p;

	scanf("%d",&n);
	getchar();
	for(k=1;k<=n;k++){
	gets(string);
	p=string;
	if((*p=='_')||(*p>='a'&&*p<='z')||(*p>='A'&&*p<='Z'))
	{
		for(i=0;*(p+i)!='\0';i++)
		{
			if((*(p+i)=='_')||(*(p+i)>='a'&&*(p+i)<='z')||(*(p+i)>='A'&&*(p+i)<='Z')||(*(p+i)>='0'&&*(p+i)<='9'));
			else
			{
			printf("0\n");
			break;}
		}
		if(*(p+i)=='\0')
			printf("1\n");
	}
	else 
		printf("0\n");}
	return 0;
}
void main()
{int n,i,j,flag;
 char *p;
 scanf("%d\n",&n);
 for(i=0;i<n;i++)
 {p=(char*)malloc(81*sizeof(char));
  gets(p);
  flag=1;
  if(*p!='_' && (*p<'A'||*p>'Z') && (*p<'a'|| *p>'z')) flag=0;
  for(j=1;*(p+j)!='\0';j++)
	  if( (*(p+j)!='_') && (*(p+j)<'A'|| *(p+j)>'Z') &&(*(p+j)<'a'||*(p+j)>'z') && (*(p+j)<'0'||*(p+j)>'9') ) flag=0;
  printf("%d\n",flag);
  free(p);
 }
}
int main()
{
	int	i, n;
	cin >> n;
	cin.get();
	for (i = 0; i < n; i ++)
	{
		char sen[81];
		cin.getline(sen,81);
		int	sl = 0;	
		sl = strlen(sen);

		int	k = 0;
		for (k = 0; k < sl; k ++)
		{
			if(k == 0)
			{
				if(  (('a' <= sen[k]) && (sen[k] <= 'z')) || (('A' <= sen[k]) && (sen[k] <= 'Z')) || (sen[k] == '_')  )
				{continue;}
				else
				{break;}	
			}		
			else
			{
				if((('a' <= sen[k]) && (sen[k] <= 'z')) || (('A' <= sen[k]) && (sen[k] <= 'Z')) || (sen[k] == '_') || (('0' <= sen[k]) && (sen[k] <= '9')))
				{continue;}
				else
				{break;}			
			}
		}

		if(k == sl)
		{
			cout << 1 << endl;
		}
		else
		{
			cout << 0 << endl;
		}	
	}

return 0;
}
int main()
{
	char a[100][90];//?????????????
	int n,i,j,m;//n???????ij??????m???
	cin>>n;
	cin.get();
	for(i=0;i<=n-1;i++)
	{
		cin.getline(a[i],90,'\n');
	}
	for(i=0;i<=n-1;i++)//?????????
	{
		m=1;
		if(a[i][0]!='_'&&a[i][0]!='a'&&a[i][0]!='b'&&a[i][0]!='c'&&a[i][0]!='d'&&a[i][0]!='e'&&a[i][0]!='f'&&a[i][0]!='g'
			&&a[i][0]!='h'&&a[i][0]!='i'&&a[i][0]!='j'&&a[i][0]!='k'&&a[i][0]!='l'&&a[i][0]!='m'&&a[i][0]!='n'&&a[i][0]!='o'
			&&a[i][0]!='p'&&a[i][0]!='q'&&a[i][0]!='r'&&a[i][0]!='s'&&a[i][0]!='t'&&a[i][0]!='u'&&a[i][0]!='v'&&a[i][0]!='w'
			&&a[i][0]!='x'&&a[i][0]!='y'&&a[i][0]!='z'&&a[i][0]!='A'&&a[i][0]!='B'&&a[i][0]!='C'&&a[i][0]!='D'&&a[i][0]!='E'
			&&a[i][0]!='F'&&a[i][0]!='G'&&a[i][0]!='H'&&a[i][0]!='I'&&a[i][0]!='J'&&a[i][0]!='K'&&a[i][0]!='L'&&a[i][0]!='M'
			&&a[i][0]!='N'&&a[i][0]!='O'&&a[i][0]!='P'&&a[i][0]!='Q'&&a[i][0]!='R'&&a[i][0]!='S'&&a[i][0]!='T'&&a[i][0]!='U'
			&&a[i][0]!='V'&&a[i][0]!='W'&&a[i][0]!='X'&&a[i][0]!='Y'&&a[i][0]!='Z')
			m=0;
		j=1;
		while(a[i][j]!='\0')//??????????
		{
			if(a[i][j]!='_'&&a[i][j]!='a'&&a[i][j]!='b'&&a[i][j]!='c'&&a[i][j]!='d'&&a[i][j]!='e'&&a[i][j]!='f'&&a[i][j]!='g'
			&&a[i][j]!='h'&&a[i][j]!='i'&&a[i][j]!='j'&&a[i][j]!='k'&&a[i][j]!='l'&&a[i][j]!='m'&&a[i][j]!='n'&&a[i][j]!='o'
			&&a[i][j]!='p'&&a[i][j]!='q'&&a[i][j]!='r'&&a[i][j]!='s'&&a[i][j]!='t'&&a[i][j]!='u'&&a[i][j]!='v'&&a[i][j]!='w'
			&&a[i][j]!='x'&&a[i][j]!='y'&&a[i][j]!='z'&&a[i][j]!='A'&&a[i][j]!='B'&&a[i][j]!='C'&&a[i][j]!='D'&&a[i][j]!='E'
			&&a[i][j]!='F'&&a[i][j]!='G'&&a[i][j]!='H'&&a[i][j]!='I'&&a[i][j]!='J'&&a[i][j]!='K'&&a[i][j]!='L'&&a[i][j]!='M'
			&&a[i][j]!='N'&&a[i][j]!='O'&&a[i][j]!='P'&&a[i][j]!='Q'&&a[i][j]!='R'&&a[i][j]!='S'&&a[i][j]!='T'&&a[i][j]!='U'
			&&a[i][j]!='V'&&a[i][j]!='W'&&a[i][j]!='X'&&a[i][j]!='Y'&&a[i][j]!='Z'&&a[i][j]!='0'&&a[i][j]!='1'&&a[i][j]!='2'
			&&a[i][j]!='3'&&a[i][j]!='4'&&a[i][j]!='5'&&a[i][j]!='6'&&a[i][j]!='7'&&a[i][j]!='8'&&a[i][j]!='9')
			m=0;
			j++;
		}
		cout<<m<<endl;
	}
	return 0;
}
/*
 * qimofuxi_11.cpp
 * ????????C????????
 *  Created on: 2010-12-18
 *      Author: william
 */
int main()
{
	int n, m, b[1000];
	char a[1000][100];
	cin>>n;
	cin.ignore();
	for(int i=0; i<n; i++)
	{
   		cin.getline(a[i],100);
		b[i]=strlen(a[i]);
	}
	for(int j=0; j<n; j++)
	{
		if(!(a[j][0]=='_'||(a[j][0]>='A'&&a[j][0]<='Z')||(a[j][0]>='a'&&a[j][0]<='z')))
		{
			cout<<0<<endl;
		}
		else
		{
			m=1;
			for(m=1; m<b[j]; m++)
			{
				if(!(a[j][m]=='_'||(a[j][m]>='A'&&a[j][m]<='Z')||(a[j][m]>='a'&&a[j][m]<='z')||(a[j][m]>='0'&&a[j][m]<='9')))
				{
					cout<<0<<endl;
					break;
				}
			}
			if(m==b[j]) cout<<1<<endl;
		}
	}
	return 0;
}