semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n,i,j,y;
	char *p,*q;
	p=q=(char *)malloc(100*sizeof(char));
	scanf("%d",&n);
	gets(p);
	for(i=0;i<n;i++)
	{
		gets(p);
		y=1;
		for(p=q,j=0;*(p+j)!='\0';j++)
		{
			if(j==0)
				if((*(p+j)<'a'||*(p+j)>'z')&&(*(p+j)<'A'||*(p+j)>'Z')&&*(p+j)!='_')
				{
					y=0;
					break;
				}
			if(j!=0)
				if((*(p+j)<'a'||*(p+j)>'z')&&(*(p+j)<'A'||*(p+j)>'Z')&&*(p+j)!='_'&&(*(p+j)<'0'||*(p+j)>'9'))
				{
					y=0;
					break;
				}
		}
		printf("%d%s",y,i==n-1?"":"\n");
	}
}
int main()
{
    int n;
    scanf("%d",&n);
    int i,k,j,m,o;
    char s[82];
    getchar();
    for(i=0;i<n;i++)
    {
    gets(s);
    for(j=0;;j++)
    {
                 if(s[j]=='\0')
                 {
                               printf("1\n");
                               break;
                 }
                 if(j==0)
                 {
                         for(k=0;k<26;k++)
                         {
                                          if((s[j]=='a'+k)||(s[j]=='A'+k)||s[j]=='_')
                                          {
                                                                         break;
                                          }
                         }
                         if(k==26)
                         {
                                                             printf("0\n");                                                                                     
                                                             break;
                         }
                 }
                 if(j!=0)
                 {
                         for(k=0;k<26;k++)
                         {
                                          if((s[j]=='a'+k)||(s[j]=='A'+k)||s[j]=='_'||s[j]=='0'||s[j]=='1'||s[j]=='2'||s[j]=='3'||s[j]=='4'||s[j]=='5'||s[j]=='6'||s[j]=='7'||s[j]=='8'||s[j]=='9')
                                          {
                                                                         break;
                                          }
                                          }
                         if(k==26)
                         {
                                    printf("0\n");
                                    break;
                         }
                 }
                 
    }
    }
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    
}
int main()
{
 int n,i,j,k,l;
 char s[1000][100];
 scanf("%d",&n);
 for(i=0;i<=n;i++)
  gets(s[i]);
 for(i=1;i<=n;i++)
 {
  k=0;
  l=strlen(s[i]);
  if(s[i][0]<='9'&&s[i][0]>='0')
   printf("0\n");
  else
  { 
   for(j=0;j<l;j++)
   {
    if(s[i][j]>='a'&&s[i][j]<='z'||s[i][j]>='A'&&s[i][j]<='Z'||s[i][j]>='0'&&s[i][j]<='9'||s[i][j]=='_')
      k=0;
    else
    {
     k=1;
     printf("0\n");   
     break;    
    }                  
   }                
   if(k==0)
    printf("1\n"); 
  } 
 }    
 getchar();
 getchar();
 return 0;
}
main()
{
                  int n,i,m;
                  char a[1];
                  gets(a);
                  n=atoi(a);
                  for(i=0;i<n;i++)
                  {
                                  char str[80];
                                  gets(str);
                                  m=strlen(str);
                                  int p=0;
                                  
                                  if( ( (str[0]>='a')&&(str[0]<='z') ) || ( (str[0]>='A')&&(str[0]<='Z') ) || (str[0]=='_') )
                                  {
                                          for(int k=1;k<m;k++)
                                          {
                                                  if( ( (str[k]>='a')&&(str[k]<='z') ) || ( (str[k]>='A')&&(str[k]<='Z') ) || (str[k]=='_') || ( (str[k]>='0')&&(str[k]<='9') ) )
                                                  ;
                                                  else 
                                                  p=1;       
                                          }
                                  }
                                  
                                  else
                                  p=1;
                                  if(p==0)
                                  printf("1\n");
                                  else
                                  printf("0\n");
                  }
}
int main()
{
    int n,i,j;
	cin>>n;
	char str[100][81];
	cin.get();
	for(i=0;i<n;i++)
	{
		cin.getline(str[i],81);
		if(str[i][0]!='_'&&((str[i][0]-'a'<0)||(str[i][0]-'z'>0))&&((str[i][0]-'Z'>0)||(str[i][0]-'A'<0)))
		{
			cout<<0<<endl;
			continue;
		}
		for(j=1;str[i][j]!='\0';j++)
		{
			if((str[i][j]!='_')&&((str[i][j]-'z'>0)||(str[i][j]-'a'<0))&&((str[i][j]-'Z'>0)||(str[i][j]-'A'<0))&&(str[i][j]!='0'&&str[i][j]!='1'&&str[i][j]!='2'&&str[i][j]!='3'&&str[i][j]!='4'&&str[i][j]!='5'&&str[i][j]!='6'&&str[i][j]!='7'&&str[i][j]!='8'&&str[i][j]!='9'))
			{
				cout<<0<<endl;
				break;
			}
		}
		if(str[i][j]=='\0')
           cout<<1<<endl;
	}
			   

    return 0;
}
/*
 * pandshfwc++hfyy.cpp
 *
 *  Created on: 2011-12-10
 *      Author: q
 */
int judgerr(char *);//???????????
int main()
{
	int n,i;//?????????
	char a[1000][81]={0},(*p)[81],b[10];//??????????B?????
	p=a;//??????
	cin>>n;
	cin.getline(b,10);
	for(i=0;i<n;i++)//??
		{
		cin.getline(*p,81);
		p++;
		}
	p=a;//???????
	while(p<(a+n))//??????????
	{
		int judgement=judgerr(*p);
		cout<<judgement<<endl;//????
		p++;//????
	}
	return 0;

}
int judgerr(char *p1)
{
	int judger=1;
	if(*p1<65||(*p1>'Z'&&*p1<'a'&&*p1!='_')||*p1>'z')//????C++???
		judger=0;
	else
	{
		p1++;//?????2?
	while(*p1!='\0')
	{
		if((*p1>'9'&&*p1<64)||(*p1>'Z'&&*p1<'a'&&*p1!='_')||*p1>'z'||*p1<'0')//?????
		{
			judger=0;
			break;
		}
		p1++;//????
	}
	}
	return judger;
}
int panduan(char a){
	int result=0;
	if((a>='a'&&a<='z')||(a>='A'&&a<='Z')||(a>='0'&&a<='9')||(a=='_'))
		 result=1;
	return result;
}
int first(char b){
	int result=0;
	if((b>='a'&&b<='z')||(b>='A'&&b<='Z')||(b=='_'))
		result=1;
	return result;
}
int main(int argc, char* argv[])
{
	int i,n,j,len,flag;
	int panduan(char a);
	int first(char b);
	char s[81];
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		gets(s);
		len=strlen(s);
		flag=1;
		if(first(*s)==0)
			flag=0;
		else if(first(*s)==1){	
			for(j=1;j<len;j++){
				if(panduan(*(s+j))==0){
				flag=0;
				break;
				}
			}
		}
		if(flag==1){
			printf("1\n");
		}
		else{
			printf("0\n");
		}
	}
	return 0;
}
int main()
{
	int n, i, j, len,count;
	char word[81];
	cin >> n;
	cin.get();
	for ( i = 0; i < n; i ++ )
	{
		cin.getline(word,81);
		len = strlen(word);	
		if ( word[0] == '_' || (word[0] >= 'A' && word[0] <= 'Z') || (word[0] >='a'&& word[0] <= 'z'))
		{
			count = 1;
			for ( j = 1; j < len; j ++ )
			{
			
				if ( word[j] == '_' || (word[j] >= 'A' && word[j] <= 'Z') || (word[j] >='a'&& word[j] <= 'z') || (word[j]<='9' && word[j] >='0') )
				count ++;
			}
			if ( count == len )
				cout << 1 << endl;	
			else
				cout << 0 << endl;
		}
		else 
			cout << 0 << endl;
		cin.clear();
	}
	return 0;
}
void main()
{
	char s[101];
	char *p;
	int i=0,j=0,m=0,n=0,k=0,e;
	p=s;
	scanf("%d",&e);
	for(j=0;j<=e;j++)
	{	gets(s);
		k=strlen(s);
		
		for(i=0;i<k;i++)
		{	n=0;
			p=s;
			if((i==0)&&!(*(p+i)>='A'&&*(p+i)<='Z'||*(p+i)>=97&&*(p+i)<=122||*(p+i)==95))n=1;
		
			if(i!=0&&(*(p+i)<65&&*(p+i)>57||*(p+i)<48||*(p+i)>90&&*(p+i)<97||*(p+i)>122)&&*(p+i)!=95)n=1;

			if(n==1){printf("0\n");break;}
			
			else if(n==0&&i==k-1){printf("1\n");break;}
		}
	}


}
int main()
{
	int n,i,l,j,t=1;
	char a[81];
	cin>>n;
	cin.get();
	while(cin.getline(a,81,'\n'))
	{
		l=strlen(a);
		if(!((a[0]=='_')||(a[0]<='z'&&a[0]>='a')||(a[0]<='Z'&&a[0]>='A')))
		{
			t=0;
			cout<<"0"<<endl;
			continue;
		}
		if((a[0]=='_')||(a[0]<='z'&&a[0]>='a')||(a[0]<='Z'&&a[0]>='A'))
		{
			t=1;
			for(j=0;j<l;j++)
			{
				if(!((a[j]=='_')||(a[j]<='z'&&a[j]>='a')||(a[j]<='Z'&&a[j]>='A')||(a[j]<='9'&&a[j]>='0')))
				{
					t=0;
					break;
				}
			}
			if(t==0) cout<<"0"<<endl;
			if(t==1) cout<<"1"<<endl;
		}
	}
	return 0;
}
/*
 * qizhong_4.cpp
 *
 *  Created on: 2010-11-28
 *      Author: Iris
 *C????????????????????????????????????
 *????????????n????????????C?????????
 *??????1??????0
 *??????????????????????
 *?????????????80?????
 *???????????????????????1????????0????
 *
 */


int main(void)//?????
{
	int n,i,j;//??????n??????????i?j?????
	char a[81];//?????a
	cin>>n;//?????????
	cin.getline(a,81);//??n???????
	for(i=0;i<n;i++){//?????????????
		cin.getline(a,81);//?????
		int len=strlen(a);//???????
		if(a[0]!='_'&&(a[0]<65||(a[0]>90&&a[0]<97)||a[0]>122))
			cout<<0<<endl;//??????????????????0
		else{//??
			for(j=1;j<len;j++)//????????????
				if(a[j]!='_'&&(a[j]<48||(a[j]>57&&a[j]<65)||(a[j]>90&&a[j]<97)||a[j]>122)){
					cout<<0<<endl;//???????????????0
					break;}//???????????
		    if(j==len)
			    cout<<1<<endl;}}//?????????????????1
	return 0;//??????????????????
}
int first_test(char a);
int test(char a);
int main()
{
	char a[101][85];
	int n,i,j,l;
	int final;
	cin>>n;
	cin.get();
	for(i=1;i<=n;i++)
	{   
		cin.getline(a[i],85,'\n');
		l=strlen(a[i]);
		final=first_test(a[i][0]);
		for(j=1;j<l;j++) final=final*test(a[i][j]);
		cout<<final<<endl;
	}
	return 0;
}
int first_test(char a)
{
	if((a>='a'&&a<='z')||(a>='A'&&a<='Z')||a=='_') return (1);
	else return (0);
}
int test(char a)
{
	if((a>='a'&&a<='z')||(a>='A'&&a<='Z')||a=='_'||(a>='0'&&a<='9')) return (1);
	else return (0);
}
int main()//?????
{
	int n,i,j,p,b[100][81];
	char a[100][81];//????
	cin>>n;
	cin.get();
	for(i=0;i<n;i++)
			cin.getline(a[i],81);//??
	for(i=0;i<n;i++)
		for(j=0;j<strlen(a[i]);j++)
			b[i][j]=a[i][j];//b[i][j]???a[i][j]?ascii?
	for(i=0;i<n;i++)
	{
		if(!(b[i][0]=='_'||(b[i][0]>='a'&&b[i][0]<='z')||(b[i][0]>='A'&&b[i][0]<='Z')))//????????
		{
			cout<<0<<endl;//??
			continue;
		}
		p=1;//??
		for(j=1;j<strlen(a[i]);j++)
			if(!(b[i][j]=='_'||(b[i][j]>='a'&&b[i][j]<='z')||(b[i][j]>='A'&&b[i][j]<='Z')||(b[i][j]>='0'&&b[i][j]<='9')))//????????
			{
				p=0;//??
				break;
			}
			cout<<p<<endl;//??
	}
	return 0;
}//?????
int main()
{
	int n,i,j,k,p;
	cin>>n;
	char a[1000][100];
	for(i=1;i<=n+1;i++)
	{
		cin.getline(a[i],100);
		if(i==1)continue;
		else{p=1;
		k=strlen(a[i]);
		if(((a[i][0]>='a'&&a[i][0]<='z')||(a[i][0]>='A'&&a[i][0]<='Z')||(a[i][0]=='_'))==0)

			p=0;

		else { for(j=1;j<k;j++)
			if(((a[i][j]>='a'&&a[i][j]<='z')||(a[i][j]>='A'&&a[i][j]<='Z')||(a[i][j]=='_')||(a[i][j]>='0'&&a[i][j]<='9'))==0)

			p=0;


		}
	}
		if(p==1)cout<<'1'<<endl;
		else if(p==0)cout<<'0'<<endl;
	}
	return 0;


}
main()
{
    int n;
	scanf("%d",&n);
	getchar();
	int i,j,k,BL;
	char a[85];
	for (i=0;i<n;i++)
	{
		gets(a);
		BL=1;
		//if '_'begin
		if (a[0]=='_')
		{
			for (j=1;j<strlen(a);j++)
				if (a[j]!='-')
					break;
			for (k=j;k<strlen(a);k++)
				if ((a[k]>='a' && a[k]<='z') || (a[k]>='A' && a[k]<='Z') || (a[k]=='_') || (a[k]>='0' && a[k]<='9'))
					BL=1;
				else
				{
					BL=0;
					break;
				}
		}
		else if ((a[0]>='a' && a[0]<='z') || (a[0]>='A' && a[0]<='Z'))
		{
			for (k=0;k<strlen(a);k++)
				if ((a[k]>='a' && a[k]<='z') || (a[k]>='A' && a[k]<='Z') || (a[k]=='_') || (a[k]>='0' && a[k]<='9'))
					BL=1;
				else
				{
					BL=0;
					break;
				}
		}
		else 
			BL=0;
		printf("%d\n",BL);
	}
}
int main()
{
	int n,i,l,j,p,m;
	char c[81];
	scanf("%d",&n);
	gets(c);
	//printf("ssss:%s\n",c);


	for(i=0;i<n;i++)
	{
		gets(c);
		//printf("aaaaaa:%s\n",c);
		l=strlen(c);
		for(j=0;j<l;j++)
		{
			if((c[j]>47&&c[j]<58)||(c[j]>64&&c[j]<91)||(c[j]<123&&c[j]>96)||c[j]==95)
			{
				m=1;
			}
			else
			{
				m=0;
				break;
			}
		}
		if(c[0]>47&&c[0]<58)
			m=0;
		printf("%d\n",m);
	}
	return 0;
}
int main()
{
	int n,i;
	char sen[81];
	cin>>n;
	cin.get();
	while ( n-- )
	{
		cin.getline( sen,81 );
		if ( ( sen[0] == '_' ) || ( ( sen[0]<='Z' ) && ( sen[0] >='A' ) ) || ( ( sen[0]<='z' ) && ( sen[0]>='a' ) ) )
		{
			for ( i=1;sen[i] != '\0';i++ )
			{
				if ( ( sen[i] == '_')|| ( ( sen[i]<='Z' ) && ( sen[i] >='A' ) ) || ( ( sen[i]<='z' ) && ( sen[i]>='a' ) ) || ( ( sen[i]<='9' ) && ( sen[i] >='0' ) ) )
				{
					continue;
				}
				else
				{
					cout<<"0"<<endl;
					break;
				}
			}
			if ( sen[i] == '\0' )
			{
				cout<<"1"<<endl;
				continue;
			}
		}
		else
		{
			cout<<"0"<<endl;
			continue;
		}
	}
	return 0;
}
char s[81];
int a;
int main()
{
	int str,l,i,n,m,p;
	cin>>n;
	getchar();
	for(l=0;l<n;l++)
	{  
		
	    cin.getline(s,81);
		str=strlen(s);
		m=0;
		p=0;
	
		if(s[0]=='_'||(s[0]>='a'&&s[0]<='z')||(s[0]>='A'&&s[0]<='Z'))
			m=1;
		else
			m=0;
		for(i=0;i<str;i++)
		{
			if(s[i]=='_'||(s[i]>='0'&&s[i]<='9')||(s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
				p=1;
			else
			{
				p=0;
				break;
			}
		}
	
		if(p&&m==1)
			a=1;
		else
			a=0;
		cout<<a<<'\n';
	}
	return 0;
}
void main()
{
	int n,i,pd=0;
	char zf[82],*ptr;
	scanf("%d ",&n);
	for(i=0;i<n;i++)
	{
		gets(zf);
		ptr=&zf[0];
		if((*ptr>='a'&&*ptr<='z')||(*ptr>='A'&&*ptr<='Z')||*ptr=='_')
			pd=pd;
		else
			pd++;
		ptr++;
		for(;*ptr!='\0';ptr++)
		{
			if((*ptr>='a'&&*ptr<='z')||(*ptr>='A'&&*ptr<='Z')||*ptr=='_'||(*ptr>='0'&&*ptr<='9'))
				pd=pd;
			else
				pd++;
		}
		if(pd!=0)
			printf("0\n");
		else
			printf("1\n");
		pd=0;
	}
}
void main()
{
	int n,i,j,k,l;
	char str[1000][80],c;
	char (*p)[90];
	scanf("%d\n",&n);
	p=str;
	for (i=0;i<n;i++) gets(*(p+i));
	for (i=0;i<n;i++)
	{
		l=strlen(*(p+i));
		k=0;
		for (j=1;j<l;j++) 
		{
			c=*(*(p+i)+j);
			if (!((c>='0'&&c<='9')||(c>='a'&&c<='z')||(c>='A'&&c<='Z')||(c=='_'))) k=1;
		}
		c=**(p+i);
	    if (!((c=='_')||(c<='Z'&&c>='A')||(c<='z'&&c>='a'))) k=1;
		if (k==0) printf("1\n");
		else printf("0\n");
	}
}
int main()
{
	int n,i,j;
	cin>>n;
	cin.get();
	char a[200][200];
	for(i=1;i<=n;i++)
		cin.getline(a[i],200);
	for(i=1;i<=n;i++)
	{
		if((a[i][0]!='_')&&((a[i][0]<'A')||((a[i][0]>'Z')&&(a[i][0]<'a'))||(a[i][0]>'z')))
			cout<<0<<endl;
		else
		{
			for(j=0;a[i][j]!='\0';j++)
			{	if((a[i][j]=='_')||((a[i][j]<='Z')&&(a[i][j]>='A'))||((a[i][j]>='a')&&(a[i][j]<='z'))||((a[i][j]>='0')&&(a[i][j]<='9')))
					continue;
				else
				{
					cout<<0<<endl;
				    break;
				}
			}
		if(a[i][j]=='\0')
			cout<<1<<endl;
		}
	}


	return 0;
}
void fun(char data[])
{
     int len = strlen(data);
     int i;
     int ya;
     
     ya = ( *data == '_' || (*data >= 'A' && *data <= 'z') );
     
     for(i = 1; i <= len - 1; i++)
           if(!alphabet && !number)
                     ya = 0;
     
     printf("%d\n", ya);
}

int main()
{
    int n;
    scanf("%d\n", &n);
    int i;
    char data[81];
    
    for(i = 1; i <= n; i++)
    {
          gets(data);
          fun(data);
    }
        
    return 0;
}
int main()
{
    int n,k=1,i,m;
    scanf("%d\n",&n);

    char str[81];
    while(k<=n)
    {
		gets(str);
		m=strlen(str);
		if((str[0]!='_') && 
			( (str[0]<'A') || (str[0]>'Z'&&str[0]<'a') || (str[0]>'z') )
			)
			printf("0\n");
		else 
		{
			if(m==1) 
				printf("1\n");
			else
			{
				i=1;
				while(i<=m)
				{
					if((str[i]!='_')&&(str[i]<'A'||(str[i]>'Z'&&str[i]<'a')||str[i]>'z')&&((str[i]<'0')||(str[i]>'9')))
					{
						printf("0\n");break;
					}
					else if(i==m-1) 
					{
						printf("1\n");break;
					}
					i=i+1;
				}
			}
		}
        k=k+1;
    }
    return 0;
}
/*
2010 11 20 ??

??
C???????????????????????????????????? 
????????????n????????????C???????????????1?????

?0
????
?????????????????????? 
?????????????80?????
????
???????????????????????1????????0????


?? 1000012760
*/


int Legal0(char z){
	if((z> 64) && (z< 91))
		return 1;
	else if((z> 96) && (z< 123))
		return 1;
	else if(z== '_')
		return 1;
	else
		return 0;
}

int Legal(char z){
	if(((z> 64) && (z< 91)) || ((z> 96) && (z< 123)))
		return 1;
	else if((z> 47) && (z< 58))
		return 1;
	else if(z== '_')
		return 1;
	else
		return 0;
}



int main(){

	char str[81];
	int i= 0, j= 0, n= 0, len, sum= 0;

	cin>>n;

	getchar();
	
	for(i= 0; i< n; i++){
		sum= 0;
		cin.get(str, 81, '\n');
		getchar();

		len= strlen(str);

		sum+= Legal0(str[0]);
		
		for(j= 1; j< len; j++){
			sum+= Legal(str[j]);
		}
		
		if(sum== len)
			cout<<"1"<<endl;
		else
			cout<<"0"<<endl;
	}

	return 0;
}
char str[90] ;
int main ()
{
	int n , i , j , len ;
	cin >> n ;
	cin.ignore() ;
	for ( i = 0 ; i < n ; i ++ )
	{
		cin.getline ( str , 90 ) ;
		len = strlen(str) ;
		for ( j = 0 ; j < len ; j ++ )
		{
			if (!(
				 (str[0] == '_')
				 || (( str[0] - 'a' >= 0 ) && ( str[0]-'a' < 26 ))
				 || ((str[0] - 'A' >= 0 )&&( str[0] - 'A' < 26))
				 )) break ;
			if (!(
				(( str[j] >= '0' ) && ( str[j] <= '9' ))
				|| (( str[j] - 'a' >= 0 ) && ( str[j]-'a' < 26 ))
				|| ((str[j] - 'A' >= 0 ) && ( str[j] - 'A' < 26))
				|| (str[j] == '_')
				)) break ;
		}
		if ( j == len ) cout << "1" <<endl ;
		else cout << "0" <<endl ;
	}
	return 0;
}
int main()
{
	int i,num,b1,b2,pd,b0[100];
	char a[100],e,b3;
	scanf("%d\n",&num);
	for(i=0;i<num;i++)
	{
		b1=0;
		pd=0;
		while((b3=getchar())!='\n')
		{
			a[b1]=b3;
			b1++;
		}
		a[b1+1]='\0';
		if(a[0]=='\0'||a[0]=='\n')
		{
			pd=0;
		}
		if(a[0]==95||(a[0]>=65&&a[0]<=90)||(a[0]>=97&&a[0]<=122))
		{
			pd=1;
		}
		else
		{
			pd=0;
		}
		for(b2=1;b2<b1;b2++)
		{
			if(a[b2]<48||a[b2]>122)
			{
				pd=0;
				break;
			}
			if(a[b2]>57&&a[b2]<65)
			{
				pd=0;
				break;
			}
			if(a[b2]>90&&a[b2]<95)
			{
				pd=0;
				break;
			}
			if(a[b2]>95&&a[b2]<97)
			{
				pd=0;
				break;
			}
			if(a[b2]>122)
			{
				pd=0;
				break;
			}
		}
		
		b0[i]=pd;
		for(b2=0;b2<b1;b2++)
		{
			a[b2]='\0';
		}
	}
	for(i=0;i<num;i++)
	{
		e=b0[i];
		printf("%d\n",e);
	}
	
	return 0;
}
int main(int argc, char *argv[])
{
  int i,j,k,n,m,x=0;
  char a[80]={'\0'};
  scanf("%d\n",&n);
  for(j=0;j<n;j++)
  {char a[80]={'\0'};
  gets(a);
  x=0;
  if(a[0]=='_'||(a[0]>='a'&&a[0]<='z')||(a[0]>='A'&&a[0]<='Z'))
  x=1;
  else x=0;
     for(k=1;k<80;k++)
       {if(a[k]=='_'||(a[k]>='a'&&a[k]<='z')||(a[k]>='A'&&a[k]<='Z')||(a[k]>='0'&&a[k]<='9'))
         x=x;
         else {if(a[k]!='\0')
           x=0;
           else {
                 for(m=k;m<80;m++)
                   {if(a[k]!='\0')
                        {x=0;
                          break;
                          }
                   }
                   if(m=80)x=x;
               }}
       }
  printf("%d\n",x);}
  return 0;
}
void main()
{
 int n,i,j;
 char b[10];
 scanf("%d",&n);
 gets(b);
 char **p;
 p=(char **)malloc(n*sizeof(char));
 for(i=0;i<n;i++)
 {
  p[i]=(char *)malloc(80*sizeof(char));
  gets(p[i]);
  j=1;
  if(*p[i]=='_'||(*p[i]>='a'&&*p[i]<='z')||(*p[i]>='A'&&*p[i]<='Z'))
  {
   while(*(p[i]+j)!='\0')
   {
    if(*(p[i]+j)=='_'||(*(p[i]+j)>='0'&&*(p[i]+j)<='9')||(*(p[i]+j)>='a'&&*(p[i]+j)<='z')||(*(p[i]+j)>='A'&&*(p[i]+j)<='Z')) j++;
	else break;
   }
    if(*(p[i]+j)=='\0') printf("1\n");
	else printf("0\n");
  }
  else printf("0\n");
 }
}
main ()
{
     int a,b,c,d,i,j;
     char f[90];
     char g[20];
     scanf("%d",&a);
     gets(g);
     for(i=0;i<a;i++)
     {
                     gets(f);
                     if(f[0]=='_')
                     {
                                 d=0;
                                 for (j=1;j<90;j++)
                                 {
                                     if ((f[j]>='0' && f[j]<='9') || (f[j]>='a' && f[j]<='z')|| (f[j]>='A' && f[j] <='Z') || f[j]=='_');
                                     else if (f[j]=='\0')
                                     break;
                                     else
                                     {
                                          printf("0\n");
                                          d=1;
                                          break;
                                     }
                                     }
                     if (d==0)                    
                     printf("1\n");            
                     }
                     else if ((f[0]>='a' && f[0]<='z')|| (f[0]>='A' && f[0] <='Z'))
                     {
                                 d=0;
                                 for (j=1;j<90;j++)
                                 {
                                     if ((f[j]>='0' && f[j]<='9') || (f[j]>='a' && f[j]<='z')|| (f[j]>='A' && f[j] <='Z') || f[j]=='_');
                                     else if (f[j]=='\0')
                                     break;
                                     else
                                     {
                                          printf("0\n");
                                          d=1;
                                          break;
                                     }
                                     }
                     if (d==0)                    
                     printf("1\n");            
                     }
                     else 
                     printf("0\n");
     }
     getchar();
     getchar();
     getchar();
}
int main()
{
	int n,i,j;
	scanf("%d\n",&n);
	char str[100];
	int flag;
	for(i=1;i<=n;i++)
	{
		flag=1;
		gets(str);
		for(j=0;j<strlen(str);j++)
		{
		if (!(str[j]=='_'||(str[j]>='a'&&str[j]<='z')||(str[j]>='A'&&str[j]<='Z')||(str[j]>='0'&&str[j]<='9'))) 
		{
	        flag=0;
			break;
		}
		if(j==0&&(str[j]>='0'&&str[j]<='9'))
		{
			flag=0;
		}
		}
		printf("%d\n",flag);
	}
	return 0;
}
int main()
{
	int n,i,j,len[100]={0},sum[100]={0};
	char str[100][81];
	cin>>n;
	cin.get();
	for(i=0;i<n;i++)
		cin.getline(str[i],81,'\n');
	for(i=0;i<n;i++)
	{
		if((str[i][0]=='_')||('A'<=str[i][0]&&str[i][0]<='Z')||('a'<=str[i][0]&&str[i][0]<='z'))
		{
			for(j=1;j<81;j++)
			{
				if(str[i][j]=='\0') break;
				len[i]++;
				if((str[i][j]=='_')||('a'<=str[i][j]&&str[i][j]<='z')||('A'<=str[i][j]&&str[i][j]<='Z')||('0'<=str[i][j]&&str[i][j]<='9'))
					sum[i]++;
			}
			if(len[i]==sum[i])
				cout<<1<<endl;
			else
				cout<<0<<endl;
		}
		else cout<<0<<endl;
	}
	return 0;
}
int main()
{
    int n,i,t;
    scanf("%d\n",&n);
     for(i=0;i<n;i++)
    {
                    t=1;
                     char c[1000];
                     gets(c);
                    int l;
                    l=strlen(c);
                   if (c[0]>='0'&&c[0]<='9')
                    {
                        printf("0\n");
                    }
                    else
                    {
                      for(int j=0;j<l;j++)
                      {
                           if(c[j]!='_'&&(c[j]<'a'||c[j]>'z')&&(c[j]<'A'||c[j]>'Z')&&(c[j]<'0'||c[j]>'9'))
                           {
                                      printf("0\n");
                                      t=0;
                                      break;
                           }
                      }
                      if(t==1)
                      printf("1\n");
                    }
    //getchar();
    }
}
int main(){
	int n,i,j,flag;
	char s[81];
	scanf("%d\n",&n);
	for(i=0;i<n;i++){
		gets(s);
		flag=1;
		if( (s[0]>='a' && s[0]<='z') || (s[0]>='A' && s[0]<='Z') || s[0]=='_'){
			if(strlen(s)==1){
				flag=1;
			}else{
				for(j=1;j<strlen(s);j++){
		    		if( (s[j]>='a' && s[j]<='z') || (s[j]>='A' && s[j]<='Z') || (s[j]>='0' && s[j]<='9') ||s[j]=='_'){
			    		continue;
					}else{
			    		flag=0;
			    		break;
					}
				}
			}
		}else{
			flag=0;
		}
		printf("%d\n",flag);
	}
	return 0;
}
int main()
{   
   char Char[100][100]={0};   //??????????
   int i=0;             
      //?????i
   int n=0;                 //??????n
   int k=0;                    //?????K
   cin>>n;
   cin.get();
    for (k=0;k<n;k++)           //????
      { cin.getline(Char[k],100,'\n');}

       for (k=0;k<n;k++)    //?????????
           {
              if (Char[k][0]<='Z'&&Char[k][0]>='A'||Char[k][0]<='z'&&Char[k][0]>='a'||Char[k][0]=='_') // ???????????????
                 {for (i=1;i<100;i++)
                    {  if ( Char[k][i]==0)          //???????????????????1
                        {cout<<1<<endl;
                                 break;
                        }
                       if ((Char[k][i]<='Z'&&Char[k][i]>='A')+(Char[k][i]<='z'&&Char[k][i]>='a')+(Char[k][i]<='9'&&Char[k][i]>='0')+(Char[k][i]=='_')==0)   //?????0
                        { 
                          cout<<0<<endl;
                                  break;
                        }

         
                    }
                 }
             else               //????????????????????0
                  { cout<<0<<endl;}
          }
return 0;
}