semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*
 * hfbzf.cpp
 *
 *  Created on: 2011-12-11
 *      Author: miaomiao
 */
int main()
{
	int n;
	cin>>n;
	char a[81];
	int i,count;
	cin.ignore();//??????
	while(n--)
	{
	cin.getline(a,81);//????????
	count=0;//??
	for(i=0;a[i];i++)
	{
	if((a[0]=='_')||(a[0]>='a'&&a[0]<='z')||(a[0]>='A'&&a[0]<='Z'))//???????
	{
			if((a[i]=='_')||(a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')//????????
					||(a[i]>='0'&&a[i]<='9'))
				count++;//???????
	}
	}
	if(count==strlen(a))//????????????
		cout<<"1"<<endl;
	else
		cout<<"0"<<endl;
	}
	return 0;
}
int main()
{
	int n,i,j,k,a[1000],p,q;
	char str[1000][90];
	cin>>n;
	cin.get();
	for (i=1;i<=n;i++)
	{
		cin.getline(str[i],88);
	}
	for (j=1;j<=n;j++)
	{
		a[j]=strlen(str[j]);
	}
	for (k=1;k<=n;k++)
	{
		if (str[k][0]=='_'||(str[k][0]>='A'&&str[k][0]<='Z')||(str[k][0]>='a'&&str[k][0]<='z'))
		{
			for (p=0;p<=a[k]-1;p++)
			{
				if (str[k][p]!='_'&&(str[k][p]<'A'||(str[k][p]>'Z'&&str[k][p]<'a')||str[k][p]>'z')&&(str[k][p]<'0'||str[k][p]>'9'))
					break;
			}
			if (p==a[k])
				cout<<"1"<<endl;
			else 
				cout<<"0"<<endl;
		
		}
		else 
			cout<<"0"<<endl;

	}
	return 0;
}
int main ()
{
	int n;
	cin>>n;						//????????n
	getchar ();					//???????
	for ( int i=0; i<n; i++ )
	{
		char a[81];				//????????
		cin.getline(a,81);
		int j;
		int l=strlen(a);
		if ( (a[0]>='a'&&a[0]<='z')//?????????????????
				||(a[0]>='A'&&a[0]<='Z')
				||a[0]=='_')
			{
				for ( 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]=='_'))
						continue;
					else
						break;
				}
				if ( j==l )				//???????????????1
					cout<<"1"<<endl;
				else
					cout<<"0"<<endl;   //??????0
			}
		else
			cout<<"0"<<endl;      //??????????0
	}
return 0;         //???????????
}               //????
main()
{
      int n,i,j,l,x=1;
      char c[1000],s[10];
      gets(s);
      n=atoi(s);
      for(i=0;i<n;i++)
      {
          gets(c);
          l=strlen(c);
          for(j=0;j<l;j++)
          {
                          if(j==0)
                          {
                                  if(c[0]=='_'||(c[0]>='a'&&c[0]<='z')||(c[0]>='A'&&c[0]<='Z'))
                                  x=1;
                          else
                          {
                              x=0;
                              break;
                          }
                          }
                          else if(c[j]=='_'||(c[j]>='a'&&c[j]<='z')||(c[j]>='A'&&c[j]<='Z')||(c[j]>='1'&&c[j]<='9')||c[j]=='0')
                          x=1;
                          else
                          {
                              x=0;
                              break;
                          }
          }
          if(x==0)
          printf("0\n");
          else
          printf("1\n");
      }
      getchar();
      getchar();
}
int main()
{
	int n,i,j,k,b;
	cin>>n;
	char a[200][100];
	for(i=0;i<=n;i++)
	{
		cin.getline(a[i],100);
	}
	for(j=1;j<=n;j++)
	{
		b=1;
	    if(a[j][0]<65||(a[j][0]>90&&a[j][0]<95)||a[j][0]==96||a[j][0]>122)b=0;
	    for(k=1;a[j][k]!='\0';k++)
		{
			if(a[j][k]<48||(a[j][k]>57&&a[j][k]<65)||(a[j][k]>90&&a[j][k]<95)||a[j][k]==96||a[j][k]>122)b=0;
		}	
	    cout<<b<<endl;
	}
	return 0;
}
int main()                                                                                                                   //?????
{
	int n,i,p[200],j,m;                                                                                                      //??????
	char str[100];                                                                                                           //??????
	cin>>n;                                                                                                                  //?????n
	for(i=0;i<200;i++)
		p[i]=1;                                                                                                              //?????????????1
	for(i=0;i<n;i++){
		getchar();
		cin.get(str,200);                                                                                                    //?????
		m=strlen(str);
		if(((str[0]<='z')&&(str[0]>='a'))||((str[0]>='A')&&(str[0]<='Z'))||(str[0]=='_')){                                   //????
			for(j=1;j<m;j++){
				if(((str[j]<'a')||(str[j]>'z'))&&((str[j]<'A')||(str[j]>'Z'))&&((str[j]<'0')||(str[j]>'9'))&&(str[j]!='_')){ //?????
					p[i]=0;break;
				}}}
		else p[i]=0;
	}
	for(i=0;i<n;i++)
		cout<<p[i]<<endl;                                                                                                     //????
	return 0;
}
int pd(char *p)
{
    if((*p>='a'&&*p<='z')||(*p>='A'&&*p<='Z')||*p=='_')
	{
		for(p=p+1;*p!='\0';p++)
		{
			if(*p>='a'&&*p<='z'||(*p>='A'&&*p<='Z')||(*p>='0'&&*p<='9')||*p=='_') ;
			else break;
		}
		if(*p=='\0')  return(1);
		else return(0);
	}
	else return(0);
}
void main()
{
	int i,n;
	char *p;
	scanf("%d\n",&n);
	for(i=0;i<n;i++)
	{
		p=(char*)malloc(1000*sizeof(char));
		gets(p);
		printf("%d\n",pd(p));
	}
}
int main()
{
    int n,i,s,j,l;
	char *a=(char *)malloc(sizeof(char)*81);
	scanf("%d",&n);
	getchar();
	for(i=0;i<n;i++){
		gets(a);
        s=strlen(a);
		l=0;
		for(j=0;j<s;j++){
			if(j==0){
			if((*(a+j)>=97&&*(a+j)<=122)||(*(a+j)>=65&&*(a+j)<=90)||(*(a+j)==95)){
			   l++; 
			}
			else{
			    l=0;
				break;
			}
			}
			else{
			if((*(a+j)>=97&&*(a+j)<=122)||(*(a+j)>=65&&*(a+j)<=90)||(*(a+j)==95)||(*(a+j)>=48)&&(*(a+j)<=57)){
			   l++; 
			}
			else{
			    l=0;
				break;
			}
			}
		}
		if(l==0) printf("0\n");
		else printf("1\n");
	}
	return 0;
}
int main()
{
	char s[100],f[100]={0};
	int i,n,l,j,b;
	scanf("%d",&n);
	getchar();
	for(i=0;i<n;i++)
	{
		b=0;
		gets(s);
		if(s[0]=='_'||s[0]>='a'&&s[0]<='z'||s[0]>='A'&&s[0]<='Z')
		{
			b=1;
			l=strlen(s);
			if(l>1)
			{
				for(j=1;j<l;j++)
				{
					if(!(s[j]=='_'||s[j]>='a'&&s[j]<='z'||s[j]>='A'&&s[j]<='Z'||s[j]>='0'&&s[j]<='9')) 
					{
					   b=0;
					   break;
					}
				}
			}
		}
		if(b==1) f[i]=1;
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",f[i]);
	}
	return 0;
}
void main()
{
	int n,i,j,flag=1,len;
	char (*name)[124],p[10];
	scanf("%d/n",&n);
	gets(p);
	name=(char (*)[124])malloc(124*sizeof(char)*20);
	    gets(*name);
	for(i=1;i<n;i++)
	{   
		  gets(*(name+i));
	}
	for (i=0;i<n;i++)
	{
		flag=1;
		len=strlen(*(name+i));
		if(**(name+i)=='_'||(**(name+i)<='Z'&&**(name+i)>='A')||('a'<=**(name+i)&&**(name+i)<='z'))
		{
			for(j=1;j<len;j++)
			{
				if(!(('0'<=*(*(name+i)+j)&&*(*(name+i)+j)<='9')||('A'<=*(*(name+i)+j)&&*(*(name+i)+j)<='Z')||('a'<=*(*(name+i)+j)&&*(*(name+i)+j)<='z')||*(*(name+i)+j)=='_'))
				flag=0;
				
			}
			{if(flag==0) printf("0\n");
			else printf("1\n");}
		}
	    else printf("0\n");
	}
}
//***************************************************
//* ???: ?????C????????             *
//* ??  ????????????C???????? *
//* ??????                                    *
//* ?? ?2010?11?20?                           *
//***************************************************
int main()
{
	int n, i, p = 1;
	cin >> n;
	cin.get();
	char str[81];            //????????
	while (p <= n)          //while??????
	{
		cin.getline(str, 81);      //???????
		if (str[0] >= 'a' && str[0] <= 'z' || str[0] >= 'A' && str[0] <= 'Z'|| str[0] == '_')
		{
			if (strlen(str) == 1)
				cout << 1 << endl;                //?????????????????????????????1
			for (i = 1; str[i] != '\0'; i ++)
			{
				if (!(str[i] >= 'a' && str[i] <= 'z' || str[i] >= 'A' && str[i] <= 'Z' || str[i] >= '0' && str[i] <= '9' || str[i] == '_'))
				{
					cout << 0 << endl;
					break;
				}                          //??????????????????????????????? 0
				else if (i == strlen(str) - 1)
					cout << 1 << endl;      //?????????????? 1      
			}
		}
		else cout << 0 << endl;            //?????? ????????0
		p ++;
	}
	return 0;
}
void main()
{
	char a[81]={0};
	int n,i,j,l,r=0;
	scanf("%d\n",&n);
	for (i=0;i<n;i++)
	{
		gets(a);
		l=strlen(a);
		if ((a[0]=='_')||((a[0]<='z')&&(a[0]>='a'))||((a[0]<='Z')&&(a[0]>='A')))
			{
				r=1;
				for (j=1;j<l;j++)
				{
					if ((a[j]=='_')||((a[j]<='z')&&(a[j]>='a'))||((a[j]<='Z')&&(a[j]>='A'))||((a[j]<='9')&&(a[j]>='0')))
						r=r+1;
				}
				if (r==l) r=1;
				else r=0;
			}
		printf("%d\n",r);
		r=0;
	}
	return 0;
}
int main()
{
    int n,i,j,l;
    int flag;
    char a[100];
    scanf("%d\n",&n);
    for(i=1;i<=n;i++)
    {
        gets(a);
        flag=1;
        l=strlen(a);
        if((a[0]=='_')||(a[0]>='A'&&a[0]<='Z')||(a[0]>='a'&&a[0]<='z'))
        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'))
                continue;
            else
            {
                flag=0;
                break;
            }
        }
        else
        flag=0;
        printf("%d\n",flag);
    }
}
int main()
{
	int n, i, l, g, j;
	char a[100];
	cin >> n;
	cin.get();
	for (i=0;i<n;i++)
	{
		memset(a, 0, sizeof(a));
		cin.getline(a, 100);
		l=strlen(a);
		g=1;
		if ((a[0]>='A' && a[0]<='z') ||(a[0] == '_'))
		{
			for (j=1;j<l;j++)
			{
				if (a[j]<'0' || a[j]> 'z' ||(a[j]>'9' && a[j] <'A') )
				{
					g=0;
					break;
				}
			}
			if (g==0)
				cout << "0" << endl;
			else
				cout << "1" << endl;
		}
		else
				cout << "0" << endl;
	}			
	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++)
             {
                 if((a[j]>='a'&&a[j]<='z')||(a[j]>='A'&&a[j]<='Z')||(a[j]>='0'&&a[j]<='9')||a[j]=='_')
                 k=k;
                 else
                 k=0;
             }
             if(k==1)
             printf("1\n");
             else
             printf("0\n");
             k=1;
        }
        else
        printf("0\n");
    }
    getchar();
    getchar();
    return 0;
}
void main()
{	int t[100]={0},i,j,k,l=0;char a[81]={0};	
	scanf("%d",&k);
	getchar();
	for(;l<k;l++)
	{
		for(j=0;j<81;j++)
		{
			a[j]=getchar();
			if (a[j]=='\n'){a[j]='\0';break;}
		}
		for(i=0;i<j;i++)
		{
			if( !(a[i]>47&&a[i]<58||a[i]==95||a[i]>64&&a[i]<91||a[i]>96&&a[i]<123) ){t[l]=-1;break;}
			else if(a[0]>47&&a[0]<58){t[l]=-1;break;}
		}
	}
	for(i=0;i<k;i++)		
		printf("%d\n",t[i]+1);
}
int i,j,k;
int f[80];
int panduan()
{
	char ch[80];
    gets(ch);
	int m=strlen(ch);
	if((ch[0]==95) || (ch[0]<=90&&ch[0]>=65)||(ch[0]<=122&&ch[0]>=97))
	{
		f[j]=1;
		for(i=1;i<m;)
		{         
		     if(((ch[i]<65&&ch[i]>58)||(ch[i]<48) ||((ch[i]>90&&ch[i]<=94)||(ch[i]==96)))||(ch[i]>122))
			 {
			     f[j]=0;
		         break;
			 }
			 else
				 i++;
		}
	}
	else 
		f[j]=0;
	return f[j];
}

int main()
{
	scanf("%d\n",&k);
	for(j=0;j<k;j++)
		panduan();
	for(j=0;j<k;j++)
		printf("%d\n",f[j]);
	scanf("%d",&i);
	return 0;
}
int main()
{
	char str[81];            //_ is 95 ,A is 65, a is 97
	int i, j, l, g;
	int n;
	cin >> n;
	cin.get();
	for (i = 1; i <= n; i ++)
	{
		g = 0;
		gets(str);
		l = strlen(str);
		for (j = 0; j < l; j ++)
		{
			
			if (str[0] == '_' || (str[0] <= 'z' && str[0] >= 'a') || (str[0] <= 'Z' && str[0] >= 'A'));
			else
			{
				g = 1;
				break;
			}
			if (str[j] == '_' || (str[j] <= 'z' && str[j] >= 'a') || (str[j] <= 'Z' && str[j] >= 'A') || (str[j] >= '0' && str[j] <= '9'))
			{
				continue;
			}
			else
			{
				g = 1;
				break;
			}
		}
		if (g)
		{
			cout << 0 << endl;
		}
		else 
		{
			cout << 1 << endl;
		}
	}
	return 0;			
}
void main()
{
	int n,i,j,k;
    char *p,s[100][82];
    scanf("%d",&n);
    getchar();
    for(i=0;i<n;i++)
	{  
		gets(s[i]);
   k=0;
   p=s[i];
   {if(((int)*p>64&&(int)*p<91)||((int)*p>96&&(int)*p<123)||*p=='_')  k=k+0;
       else   k=k+1;}
   p++;
for(;*p!='\0';p++)
{  if(((int)*p>64&&(int)*p<91)||((int)*p>96&&(int)*p<123)||*p=='_'||((int)*p>47&&(int)*p<58)) k=k+0;
else k=k+1;}
if(k==0) printf("1\n");  else if(k>0)  printf("0\n");
free(*p);
}
}
int main(){
int n,i,len,k;
char x[100],a[81];
gets(x);
n=atoi(x);
for(i=0;i<n;i++){
	gets(a);
	if(a[0]=='_'||(a[0]>='a'&&a[0]<='z')||(a[0]>='A'&&a[0]<='Z'))
	{
    len=strlen(a);
	for(k=1;k<len;k++)
	{
		if(a[k]=='_'||(a[k]>='a'&&a[k]<='z')||(a[k]>='A'&&a[k]<='Z')||(a[k]>='0'&&a[k]<='9'))
		{
			continue;
		}
		else
		{
			break;
		}
	}
	}
	else{
		k=0;
	}
	if(k==len){
		printf("1\n");
	}
	else{
		printf("0\n");
	}
}
return 0;
}
int main()
{
    int n,i=0,sum;
    char c[1000];
    scanf("%d",&n);
    gets(c);
    char a[n][81];
    for (i=0;i<n;i++)
    {
        gets(a[i]);
        sum=0;
        for (int j=0;j<strlen(a[i]);j++)
          {
          if (!(a[i][j]>='0'&&a[i][j]<='9'||a[i][j]>='a'&&a[i][j]<='z'||a[i][j]>='A'&&a[i][j]<='Z'||a[i][j]=='_'))
              {
              sum=sum;
              sum=0;
              break;
              }
          else if (a[i][0]>='0'&&a[i][0]<='9')
            {
            sum=sum;
            sum=0;
            break;
            }
          else 
              sum=sum+1;
          }
          if (sum!=0)
          printf("1\n");
          else 
          printf("0\n");
    }

}
int main(){
	char a[100];//a???????
	int n,i;//n??????
	cin>>n;
	cin.getline(a,100);
	for(;n>0;n--){
		cin.getline(a,100);
		for(i=0;a[i]!=0;i++){
			if(i==0)
				if(a[i]=='_'||(a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z'))continue;
				else{cout<<'0'<<endl;break;}
			else if(a[i]=='_'||(a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')||(a[i]>='0'&&a[i]<='9'))continue;//??????????
			else{cout<<'0'<<endl;break;}
		}
		if(a[i]==0)cout<<'1'<<endl;
	}
	return 0;
}
char a[1000];
int main()
{   
    int Judge();
	int n;
	cin>>n;
	cin.get();
	int i;
	for(i=1;i<=n;i++)
	{
		memset(a,0,sizeof(a));
		cin.getline(a,1000);
		cout<<Judge()<<endl;
	}
	  		return 0;
}
int Judge()
{
	int i;
	int p=0;
	if((a[0]>='A'&&a[0]<='Z')||((a[0]<='z')&&(a[0]>='a'))||(a[0]=='_'))
		p=1;
	for(i=0;a[i]!='\0';i++)
		if((a[i]>='A'&&a[i]<='Z')||((a[i]<='z')&&(a[i]>='a'))||(a[i]=='_')||((a[i]>='0')&&a[i]<='9')){}
		else
		p=0;
	return p; 
}
void main() 
{ 	
    char a[100]; 	
    int g=0; 	
    scanf("%d\n",&g); 	
    while(g--) 	
    { 		
        int flag = 0; 		
        gets(a); 		
        if(*a == '\0') 		
        { 			
             g++; 			
             continue; 		
        } 		
        char* p = a; 		
        for(p=a;p<a+strlen(a);p++) 		
        { 			
             if((!isalpha(*p))&&(!isdigit(*p))&&(*p!='_')) 			
             { 				
                   flag = 1; 				
                   printf("0\n"); 				
                   break; 			
             } 		
        } 		
        if(flag == 1) 		
        { 			
             continue; 	
        } 		
        if(*a=='_'||isalpha(*a)) 		
        { 			
             printf("1\n"); 	
        } 		
        else 		
        { 			
             printf("0\n"); 		
        } 	
    }	 	 
}
void main()
{
	int n,i,flag;
	char a[100][100],*p[100];
	scanf("%d ",&n);
	for(i=0;i<n;i++)
	{
		gets(a[i]);
		p[i]=a[i];
	}
	for(i=0;i<n;i++)
	{
		flag=1;
		if((*p[i]<'a'||*p[i]>'z')&&(*p[i]<'A'||*p[i]>'Z')&&(*p[i]!='_'))
			flag=0;
		for(;*p[i]!='\0';p[i]++)
		{
			if((*p[i]<'0'||*p[i]>'9')&&(*p[i]<'a'||*p[i]>'z')&&(*p[i]<'A'||*p[i]>'Z')&&*p[i]!='_')
				flag=0;
		}
		if(flag==1)
			printf("1\n");
		else
			printf("0\n");
	}
}
int main(){
	int n,count=0,k,i;
	char zf[800][81],z;
	scanf("%d%c",&n,&z);
	for(i=0;i<n;i++){
		gets(zf[i]);
	}
	for(int f=0;f<n;f++){
		if(zf[f][0]=='_'||(zf[f][0]>='a'&&zf[f][0]<='z')||(zf[f][0]>='A'&&zf[f][0]<='Z')){
		    k=strlen(zf[f]);
			for(int m=0;m<k;m++){
				if(zf[f][m]=='_'||(zf[f][m]>='a'&&zf[f][m]<='z')||(zf[f][m]>='A'&&zf[f][m]<='Z')||(zf[f][m]<='9'&&zf[f][m]>='0')){
					continue;
				}else{
					count++;
					break;
				}
			}
		}else{
			count++;
		}
		if(count!=0){
			printf("0\n");
		}else{
			printf("1\n");
		}
		k=0;
		count=0;
	}
	return 0;
}
int main()
{
	int n,i,j,b,x=0;
	char c[100];
	cin>>n;
	getchar();
	for(i=0;i<n;i++)
	{
		b=1;
		cin.getline(c,100,'\n');
		if(!(c[0]>64&&c[0]<91||c[0]==95||c[0]>96&&c[0]<123))
			b=0;
		for(j=0;c[j]!='\0';j++)
			if(!(c[j]>64&&c[j]<91||c[j]==95||c[j]>96&&c[j]<123||c[j]>47&&c[j]<58))
				b=0;
		cout<<b<<endl;
	}
	return 0;
}
int main()
{
	int n, i, j, len;
	char str[10000][81];
	cin >> n;
	cin.get();
	for( i = 0; i < n; i ++ )
	{
		cin.getline(str[i], 81);
		len = strlen(str[i]);
		if( str[i][0] == '_' )
		{
			for( j = 1; j < len; j ++ )
			{
				if((str[i][j] - 'a' >= 0 && str[i][j] - 'a' <= 25) ||
			       (str[i][j] - 'A' >= 0 && str[i][j] - 'A' <=25 ) || 
				   (str[i][j] - '0' >= 0 && str[i][j] - '0' <= 9)  ||
				    str[i][j] == '_' )
				{
				}
			    else
				{
					cout << 0 << endl;
					break;
				}
			}
			if( j == len )
				cout << 1 << endl;
		}
		if( str[i][0] != '_' )
		{
			if((str[i][0] - 'a' >= 0 && str[i][0] - 'a' <= 25) ||
			   (str[i][0] - 'A' >= 0 && str[i][0] - 'A' <=25 ))
			{
				for( j = 1; j < len; j ++ )
				{
					if((str[i][j] - 'a' >= 0 && str[i][j] - 'a' <= 25) ||
			           (str[i][j] - 'A' >= 0 && str[i][j] - 'A' <=25 ) || 
				       (str[i][j] - '0' >= 0 && str[i][j] - '0' <= 9)  ||
					    str[i][j] == '_'  )
					{
					}
			        else
					{
					    cout << 0 << endl;
					    break;
					}
				}
				if( j == len )
					cout << 1 << endl;
			}
			else
				cout << 0 << endl;
		}
	}
	return 0;
}
void main()
{
	int n,i,*a,*A;
	char *p,c;
	scanf("%d\n",&n);
	a=(int*)malloc(n*sizeof(char));
	A=a;
	for(i=0;i<n;i++)
	{
		p=(char*)malloc(80*sizeof(char));
		gets(p);
		scanf("\n");
		if(*p!='_'&&((*p<'A')||((*p>'Z')&&(*p<'a'))||(*p>'z')))
		{
			*a=0;
			a++;
		}
		else
		{
			p++;
			for(;*p!='\0';p++)
		{
			if(*p!='_'&&((*p<'A')||((*p>'Z')&&(*p<'a'))||(*p>'z'))&&(*p<'0'||*p>'9'))
				break;
		}
		if(*p=='\0')
		{
			*a=1;
			a++;
		}
		else
		{
			*a=0;
			a++;
		}
		}
	}
	for(i=0;i<n;i++)
	{
		printf("%d\n",*A);
		A++;
	}
}
int main()
{
      char s[90];
      int i,n,j;
      
      scanf("%d",&n);
      gets(s);
      for (i=0;i<n;i++)
      {
          gets(s);
          if ((s[0]=='_') || (s[0]>='a' && s[0]<='z') || (s[0]>='A' && s[0]<='Z'))
          {
              for (j=1;j<strlen(s);j++)
                  if ((s[j]=='_')||(s[j]>='a' && s[j]<='z')||(s[j]>='A' && s[j]<='Z')||(s[j]>='0' && s[j]<='9'))
                      continue;
                  else
                      break;
              if (j==strlen(s))
                  printf("1\n");
              else
                  printf("0\n");
          }
          else
              printf("0\n");
      }
}
void main()
{
 int n,i,j,k,m;
 char **p;
 scanf("%d\n",&n);
 p=(char **)malloc(n*sizeof(char *));
 for(i=0;i<n;i++)
    *(p+i)=(char *)malloc(80*sizeof(char));
 for(i=0;i<n;i++)
 {
  gets(*(p+i));
 }
 for(i=0;i<n;i++)
 {
      if((*(*(p+i))>='a'&&*(*(p+i))<='z')||(*(*(p+i))>='A'&&*(*(p+i))<='Z')||(*(*(p+i))=='_'))
	  {
		 m=strlen(*(p+i));
	     for(j=0;j<m;j++)
		 {
		 if((*(*(p+i)+j)>='a'&&*(*(p+i)+j)<='z')||(*(*(p+i)+j)>='A'&&*(*(p+i)+j)<='Z')||(*(*(p+i)+j)=='_')||(*(*(p+i)+j)>='0'&&*(*(p+i)+j)<='9'))
			 k=1;
		 else
		 {
		 k=0;
		 break;
		 }
		 }
	  }
	  else
	  {
	  k=0;
	  }
	  printf("%d\n",k);
 }
 
}
int main()
{char a[100][82]={0};
 int n,i=0,j=0,k=0,l;
 cin>>n;
cin.get();
 for(i=0;i<n;i++)
{cin.getline(a[i],81);

 if(a[i][0]=='_'||(a[i][0]>='a'&&a[i][0]<='z')||(a[i][0]>='A'&&a[i][0]<='Z'))
  {l=strlen(a[i]);k=0;
    for(j=0;j<l;j++)
     {
      if(a[i][j]=='_'||(a[i][j]>='a'&&a[i][j]<='z')||(a[i][j]>='A'&&a[i][j]<='Z')||(a[i][j]>='0'&&a[i][j]<='9'))
     k++;
}
if(k==l)
 cout<<"1"<<endl;
else cout<<"0"<<endl;}
else cout<<"0"<<endl;}
return 0;
}
int main ()
{
	int n, i, flag=0,j;
	char a[81];
	cin >> n;
	cin.get();
	for (i = 1;i <= n;i++)
	{
        flag=0;
		cin.getline(a,81);
		for(j=1;a[j]!='\0';j++)
			if((a[j] < '0' ||( a[j]>'9' && a[j]<'A')||(a[j]>'Z'&&a[j]<'a')||(a[j]>'z')) && a[j]!='_' ) {flag=1; break;}
		if(flag==0)   
		{
	    	if((a[0] >= 'a' && a[0] <= 'z') || (a[0] >='A' && a[0] <='Z') || (a[0] == '_'))
		    	cout << "1" <<endl;
	    	else  cout << "0" <<endl;
		}
		else cout <<"0"<<endl;
	}
	return 0;
}
int main()
{
	int n, i,j;
	char a[90];
	cin >> n;
	cin.get();
	for(i = 0;i < n;i++)
	{
		j = 0;
		cin.getline(a,90);
		if(a[0] == '_' || (a[0] - 'A' >= 0 && a[0] - 'Z' <= 0)||(a[0] - 'a' >= 0&&a[0] - 'z' <= 0 ))
		{
			if(strlen(a) == 1)
				cout << 1 << endl;
			else
			{
				for(j = 1;j < strlen(a);j++)
				if(a[j] == '_' || (a[j] - 'A' >= 0 && a[j] - 'Z' <= 0)||(a[j] - 'a' >= 0&&a[j] - 'z' <= 0 )||(a[j] - '0'>=0&&a[j]-'9'<= 0))
					continue;
				else
					break;
			}
		}
				if(j == strlen(a) && strlen(a) != 1)
					cout << 1 <<endl;
				if(j != strlen(a) && strlen(a) != 1)
					cout << 0 <<endl;
	}
	return 0;
	}
main(){
       char *p;
       int i,j,len,n,*judge;
       scanf("%d\n",&n);
       judge=(int*)malloc(32*sizeof(int));
       
       for(i=0;i<n;i++){
         p=(char*)malloc(80*sizeof(char));
         gets(p);
         len=strlen(p);
         if(*p==' '||(*p>=65&&*p<=90)||(*p>=97&&*p<=122)||*p==95){
           for(j=0;j<len;j++){
             if( *(p+j)<'0'||(*(p+j)>'9'&&*(p+j)<65)||(*(p+j)>90&&*(p+j)<95)||*(p+j)==96||(*(p+j)>122) ) {*(judge+i)=0;break;}
           }
           if(j==len) *(judge+i)=1;
         }
         else *(judge+i)=0;
       }
       for(i=0;i<n;i++){
         printf("%d\n",*(judge+i));
       }
}
int main()
{
    int i,j,k,m,n;
    scanf("%d",&n);
    getchar();
    char a[n][100];
    for(i=0;i<n;i++)
    {
         gets(a[i]);
         if(a[i][0]!='_'&&((a[i][0]-'a')<0||(a[i][0]-'z')>0)&&((a[i][0]-'A')<0||(a[i][0]-'Z')>0))
         {printf("0\n");
         continue;
         }
         else
         {for(j=1;a[i][j]!='\0';j++)
         {
              if(a[i][j]=='\n'||a[i][j]==' ')
              {
                  printf("0\n");
                  break;
              }
              if(a[i][j]!='_'&&((a[i][j]-'a')<0||(a[i][j]-'z')>0)&&((a[i][j]-'A')<0||(a[i][j]-'Z')>0)&&((a[i][j]-'0')<0||(a[i][j]-'0')>9))
              {
                  printf("0\n");
                  break;
              }
         }
         if(a[i][j]=='\0')
         printf("1\n");
         }
    }
    getchar();
    getchar();
}
int main()
{
	int n,i,len;
	scanf("%d",&n);
	getchar();
	for(i=0;i<n;i++)
	{
		char*p;
		int s=0;
		char*a=(char*)malloc(sizeof(char)*81);
		gets(a);
		len=strlen(a);
		p=a;
		if(!((*p>='a'&&*p<='z')||(*p>='A'&&*p<='Z')||(*p=='_')))
			printf("0\n");
		else
		{
			for(p=a+1;p<a+len;p++)
			{
				if((*p>='a'&&*p<='z')||(*p>='A'&&*p<='Z')||(*p>='0'&&*p<='9')||(*p=='_'))
					s++;
			}
			if(s==len-1)
				printf("1\n");
			else
				printf("0\n");
		}

	}
	return 0;
}
/*
????????
?????2010/11/26
????00948344
????????c??????
*/


//???????????????????


int main(){
	int n;
	cin>>n;
	char a[100][100];              
	gets(a[0]);
	int i,j,len;
 	for(i=0;i<n;i++)
	gets(a[i]);
	for(i=0;i<n;i++)
	{
	  len=strlen(a[i]);
	  for(j=0;j<len;j++)
	  {
          if(j==0)
		  {
			  if((a[i][0]<'a'||a[i][0]>'z')&&(a[i][0]<'A'||a[i][0]>'Z')&&a[i][0]!='_')
			  {
				  cout<<'0'<<endl;
				  break;
			  }
		  }
		  else
		  {
			  if(((a[i][j]<'a'||a[i][j]>'z')&&(a[i][j]<'A'||a[i][j]>'Z')&&(a[i][j]<'0'||a[i][j]>'9'))&&a[i][j]!='_')
              {
				  cout<<'0'<<endl;
				  break;
			  }
		  }
	  }
	  if(j==len)
		  cout<<'1'<<endl;
	}
}
/*
 * 1.cpp
 *?????C????????
 *  Created on: 2011-12-3
 *      Author: ??
 */
int main(){//???
	int n,i;//n????? i???????
	unsigned j;//j???????
	char k,l;//k?????????????l????????????
	cin>>n;//??n
	char a[n][81];//????
	cin.getline(a[0],81);//
	for(i=0;i<n;i++)//??
		cin.getline(a[i],81);
	for(i=0;i<n;i++){//
		k=a[i][0];
		if(!(k=='_' || (k>='A'&&k<='Z') || (k>='a'&&k<='z')))//??????
		{
			cout<<0<<endl;continue;}//??????????0
		else//??
		{
			for(j=0;j<strlen(a[i]);j++){
				l=a[i][j];
				if(!(l=='_' || (l>='A'&&l<='Z') || (l>='a'&&l<='z')||(l>='0'&&l<='9')))//??????????
					{
					cout<<0<<endl;break;//???????0
					}}
			if(j==strlen(a[i])) cout<<1<<endl;//???????????????????1
		}
	}return 0;//????
}