semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char a[100];
	int m, i,j, n;
	cin >> n;
	cin.get();
	for(i = 1; i <= n; i++)
	{
		memset(a,0,sizeof(a));
		cin.getline(a,100);
		if(a[0] == '_' || a[0] >= 'a' && a[0] <= 'z' || a[0] >= 'A' && a[0] <= 'Z')
		{
			j = 1;
			while(a[j] == '_' || a[j] >= 'a' && a[j] <= 'z' || a[j] >= 'A' && a[j] <= 'Z' || a[j] >= '0' && a[j] <= '9')
			{
				j++;
			}
			if(a[j] == '\0')
			{
				m = 1;
			}
			else
			{
				m = 0;
			}
		}
		else
		{
			m = 0;
		}
		cout << m << endl;
	}
	return 0;
}
int main(){
    int i,j,l,n,o=1,count=0;
    char a[100];
    scanf("%d",&n);getchar();
    for(j=0;j<n;j++){
        gets(a);
        l=strlen(a);
        if(a[0]>='0'&&a[0]<='9') o=0;
        else{
            for(i=0;i<l;i++){
                if((a[i]>='0'&&a[i]<='9'||a[i]>='a'&&a[i]<='z'||a[i]>='A'&&a[i]<='Z'||a[i]=='_')){
                    count++;                    
                    } 
                }
            }
        if(count==l) o=1;
        else o=0;
        printf("%d\n",o);
        count=0;       
        for(i=0;i<100;i++) a[i]=' ';
        }
    
    
    scanf("%d",&i);
    return 0;
    }
int main()
{
    char num[10];
    char str[1000][80];
    int n,i,j,length,m=0;
    gets(num);
    n=atoi(num);
    for(i=0;i<n;i++)
    {
        gets(str[i]);
        length=strlen(str[i]);
        if((str[i][0]<='z'&&str[i][0]>='a')||(str[i][0]<='Z'&&str[i][0]>='A'||str[i][0]=='_'))
        {
           m=1;
           for(j=0;j<length;j++)
           {
               if((str[i][j]<='z'&&str[i][j]>='a')||(str[i][j]<='Z'&&str[i][j]>='A'||str[i][j]=='_')
               ||(str[i][j]>='0'&&str[i][j]<='9'))           
                  m=1;
               else m=0;
               if(m==0)
                break;
           }
        }
        else{m=0;} 
        printf("%d\n",m);
     }                                                                                     
     return 0;      
    
}
int main()
{ 
   
    int n,l,i,j;
    scanf("%d\n",&n);
    char c[81],*p;
    for(i=0;i<n;i++){
         gets(c);
         l=strlen(c);p=c;
         int a=1;
         if(*p==95||(*p>64&&*p<91)||(*p>96&&*p<123)){
            for(p=c+1;p<c+l;p++){
                if(*p==95||(*p>64&&*p<91)||(*p>96&&*p<123)||(*p>47&&*p<58)){a++;}
                else {printf("%d\n",0);break;}
            }
            if(a==l){printf("%d\n",1);}
         }
         else {printf("%d\n",0);}
    }                         
	return 0;
}
int dicide(char words[100])
{
    int j=0;
    int z=1;
    if (words[0]!='_'&&(words[0]<'A'||(words[0]>'Z'&&words[0]<'a')||words[0]>'z'))
       {
           z=0;
       }
    else
    {
        while (words[j]!='\0')
        {
            z=1;
            j++;
            if ((words[j]<'A'||(words[j]>'Z'&&words[j]<'a')||words[j]>'z')&&words[j]!='\n'&&words[j]!='\0'&&words[j]!='_'&&(words[j]<'0'||words[j]>'9'))
            {
                z=0;
                break;
            }
        }

    }
return (z);
}
int main()
{
    int time=0;
    cin >>time;
    cin.get();
    char a[100][100];
    int i=0;
    for (i=0;i<time;i++)
    {
        cin.getline(a[i],100);
        cout <<dicide(a[i])<<endl;
    }
return 0;
}
/*
 * 1000012850_32.5.cpp
 *  ?????C????????
 *  Created on: 2010-11-24
 *      Author: william
 */
int main()           //???
{
	int n, i, j;  //??????
	char a[101][256]; //??????a[][]
    cin>>n;        //??n
	for(i=0;i<=n;i++)
    {
	 cin.getline(a[i],256);
    }                         //for??????n????
     for(i=1;i<=n;i++)       //for???????i????????????
     {
    	 int k;
    	 k=strlen(a[i]);     //k?a[i]???
    	 if((a[i][0]>='A'&&a[i][0]<='Z')||(a[i][0]>='a'&&a[i][0]<='z')||a[i][0]=='_')  //?????????????
    	 {
             int m=0;
    		 for(j=1;j<k;j++)  //for????????2???????????
    		 {
    			 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'))
    			     m++;
    				 else
    			 {
    				 cout<<'0'<<endl;
    				 break;      //???  ???0 ?????
    				 }
       		 }
    		 if(m==k-1)
    			 cout<<'1'<<endl;  //???????? ???1
    	 }
    	 else cout<<'0'<<endl;  //??????? ???0
     }
  return 0;  //??
}  //??
void main()
{
	char zf[10000][81];
	char num[10];
	int n;
	int i,j;
	gets(num);
	n=atoi(num);
	for(i=0;i<n;i++)
	{
		gets(zf[i]);
		if((zf[i][0]<'A'||(zf[i][0]>'Z'&&zf[i][0]<'a')||zf[i][0]>'z')&&zf[i][0]!='_')
			printf("0\n");
		else
		{
			for(j=0;zf[i][j]!='\0';j++)
			{
				if((zf[i][j]<'A'||(zf[i][j]>'Z'&&zf[i][j]<'a')||zf[i][j]>'z')&&(zf[i][j]!='_')&&(zf[i][j]>'9'||zf[i][j]<'0'))
				{
					printf("0\n");
					break;
				}
				if(zf[i][j+1]=='\0')
				{
					printf("1\n");
					break;
				}
			}
		}
	}
}
int main()                 //???
{
	int n=0,i=0,count=0,l=0;
	char a[800];
	cin>>n;
	cin.getline(a,800);         //???????????
	for(;n>0;n--)                   //?????
	{
		count=0;                  //?????
		cin.getline(a,800);
		l=strlen(a);
		for(i=0;i<l;i++)
		{
			if(a[i]=='_'||(a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')||(a[i]>='0'&&a[i]<='9'))
				count+=1;
		}
		if((a[0]=='_'||(a[0]>='a'&&a[0]<='z')||(a[0]>='A'&&a[0]<='Z'))&&count==l)
			cout<<"1"<<endl;
		else
			cout<<"0"<<endl;                       //???????????
	}
	return 0;             //??
}
int main()
{
	char str[100][100]={' '};
	int n,i,j,flag1=0,flag2=0,len[100];
	cin>>n;
	cin.get();
	for(i=0;i<n;i++)
	{
		cin.getline(str[i],100);
		len[i]=strlen(str[i]);
	}
	for(i=0;i<n;i++)
	{
		flag1=0;flag2=0;
		if((str[i][0]=='_')||('a'<=str[i][0]&&str[i][0]<='z'||'A'<=str[i][0]&&str[i][0]<='Z'))
		{flag1=1;}
		for(j=0;j<len[i];j++)
		{
			flag2=0;
			if((str[i][j]=='_')||(str[i][j]>='0'&&str[i][j]<='9')||(('a'<=str[i][j]&&str[i][j]<='z')||('A'<=str[i][j]&&str[i][j]<='Z')))
			flag2=1;
			if(flag2==0)
				break;
	
		}
		if(flag1+flag2==2)
			cout<<1<<endl;
		else
			cout<<0<<endl;
	}

   return 0;
}
int main ()
{
	int n, i, j;
	cin >> n;
	cin.get();
	char str[81];
	for ( i = 1; i <= n; i++ )
	{
		cin.getline(str,81);
		if ( (str[0] >= 'a' &&  str[0] <= 'z') || ( str[0] >= 'A' &&  str[0] <= 'Z') || str[0] == '_' )
		{
			for ( j =1; str[j] != '\0'; j++ )
			{
				if ( (str[j] >= 'a' && str[j] <= 'z') || (str[j] >= 'A' && str[j] <= 'Z') || (str[j] >= '0' && str[j] <= '9') )
					continue;
				else if ( str[j] != '_' || str[j] == ' ' )
				{
					cout << "0" << endl;
					break;
				}
			}
			if ( str[j] == '\0')
				cout << "1" << endl;
		}
		else
			cout << "0" << endl;
	}
	return 0;
}
int number(char a)
{
    int c;
    c=a-'0';
    if(c>=0&&c<=9)
    return 1;
    else
    return 0;
}
int line(char a)
{
    int c;
    c=a-'_';
    if(c==0)
    return 1;
    else
    return 0;
}
int small(char a)
{
    int c;
    c=a-'a';
    if(c>=0&&c<=25)
    return 1;
    else
    return 0;
}
int big(char a)
{
    int c;
    c=a-'A';
    if(c>=0&&c<=25)
    return 1;
    else
    return 0;
}
int main()
{
    int n,i,j,c;
    char a[81];
    int b[100]={0};
    scanf("%d",&n);
    scanf("%c",&a[0]);
    for(i=1;i<=n;i++)
    {
        b[i-1]=1;
        for(j=1;j<=81;j++)
        {
            scanf("%c",&a[j-1]);
            c=a[j-1]-'\n';
            if(c==0)
            break;
            c=line(a[j-1])+number(a[j-1])+big(a[j-1])+small(a[j-1]);
            if(c==0)
            {
                b[i-1]=0;
            }
        }
        if(number(a[0])==1)
        b[i-1]=0;
    }
    for(i=1;i<=n;i++)
    printf("%d\n",b[i-1]);
    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]==' ')
                                                         return 0;
                                         if((a[i]>='a'&&a[i]<='z')||a[i]=='_'||(a[i]>='A'&&a[i]<='Z')||(a[i]>='0'&&a[i]<='9'))
                                         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[i]>='A'&&a[i]<='Z')||(a[i]>='0'&&a[i]<='9'))
                                         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();
}
int main()
{	int n,len,i,j,count;
	int a=1,b=0;
	char *p;
	char zfc[81],tem[2];
	gets(tem);
	n=atoi(tem);
	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 main()
{
    int n,i,j,l;char s[100000][81];
    scanf("%d",&n);
    for(i=0;i<n+1;i++)
      gets(s[i]);
    for(i=1;i<n+1;i++)
     {  
     if(s[i][0]!='_'&&(s[i][0]<'A'||s[i][0]>'Z')&&(s[i][0]<'a'||s[i][0]>'z') )
     printf("0\n");
    else
     { 
       l=0;
     for(j=1;s[i][j]!='\0';j++) 
       if(s[i][j]!='_'&&(s[i][j]<'A'||s[i][j]>'Z')&&(s[i][j]<'a'||s[i][j]>'z')&&(s[i][j]<'0'||s[i][j]>'9'))
        l++;
      if(l==0)
       printf("1\n");
     else
      printf("0\n");
    }
   
    }
  getchar();getchar();
}
int main()
{
    int n,i,j,k,x[100],p=0,q=0;
    char a[100][10000];
    cin>>n;
    cin.get();
    for(i=0;i<n;i++)
    {
        cin.getline(a[i],81);
    }
    for(i=0;i<n;i++)
    {
        x[i]=strlen(a[i]);
    }
    for(i=0;i<n;i++)
    {   p=0;
        if(a[i][0]=='_'||((a[i][0]<='z')&&(a[i][0]>='a'))||((a[i][0]<='Z')&&(a[i][0]>='A')))
        {
              for(j=0;j<x[i];j++)
              {
                if(((a[i][j]<65)&&(a[i][j]>57))||((a[i][j]<95)&&(a[i][j]>90))||(a[i][j]<48)||(a[i][j]>122)||(a[i][j]==96)||(a[i][j]==' '))
                p=1;
              }
        }
        else p=1;
        if (p==0)
        cout<<1<<endl;
        else cout<<0<<endl;
    }
    return 0;

}
main()
{
    char num[10];
    gets(num);
    int len=strlen(num),n=num[0]-'0';
    for(int v=1;v<len;v++)
    {
         n=n*10+num[v]-'0';   
    }
    for(int u=0;u<n;u++)
    {
       char s[81];
       gets(s);
       if((s[0]=='_')
       ||((s[0]>='a')&&(s[0]<='z'))
       ||((s[0]>='A')&&(s[0]<='Z')))  
       {
           int i=1;
           for(i=1;i<strlen(s);i++)
           {
               if((s[i]=='_')
               ||((s[i]>='a')&&(s[i]<='z'))
               ||((s[i]>='A')&&(s[i]<='Z'))
               ||((s[i]>='0')&&(s[i]<='9')))
                 continue;
               else
               {
                   printf("0\n");
                   break; 
               }     
           }
           if(i==strlen(s)) printf("1\n");
                                      
       }   
       else printf("0\n");
    }
    getchar();
    getchar();
      
}
int main()
{
	char a[100],*p;
	int n,b[100][1],*pr,len;
	scanf("%d",&n);
	gets(a);
	for(pr=*b;pr<*(b+n);pr++)
	{
		*pr='0';
		gets(a);
		len=strlen(a);
		if((*a>'z'||*a<'A')&&*a!='_')
		{
			continue;
		}
		*pr='1';
		for(p=a;p<a+len;p++)
		{
			if(((*p<'A'&&*p>'9')||*p>'z'||*p<'0')&&*p!='_')
			{
				*pr='0';
				break;
			}
		}
	}
	for(pr=*b;pr<*(b+n);pr++)
	{
		printf("%c\n",*pr);
	}
	return 0;
}
int main() {
        int n;
        cin >> n;
        cin.get();
        while (n -- > 0) {
                char s[100];
                cin.getline(s, 100);
                if (s[0] >= 'a' && s[0] <= 'z'
                        || s[0] >= 'A' && s[0] <= 'Z'
                        || s[0] == '_') {
                        int i = 0;
                        while (s[i] != '\0') {
                                if (s[i] >= 'a' && s[i] <= 'z'
                                        || s[i] >= 'A' && s[i] <= 'Z'
                                        || s[i] >= '0' && s[i] <= '9'
                                        || s[i] == '_')
                                        ;
                                else
                                        break;
                                i ++;
                        }
                        if (s[i] == '\0')
                                cout << 1 << endl;
                        else
                                cout << 0 << endl;
                }
                else {
                        cout << 0 << endl;
                }
        }
        return 0;
}
int main()
{
	int n , i , j;
	char a[82];
	char *p = a;
	cin >>n;
	getchar();                         //???? 
	for ( i = 1 ; i <= n ; i++)
	{
		p = a;
		gets(a);                     //?? 
		for (j = 0 ; j < strlen(a) ; j++ , p++)
		{
			if ( *p == '_' || (*p >= 'a' && *p<='z') || (*p >= 'A' && *p<='Z') )     //????????ok 
				continue;
			if (j!=0 && *p>='0' && *p<='9')         //????????? 
				continue;
			break;
		}
		if (j == strlen(a))
			cout<<"1"<<endl;
		else
			cout<<"0"<<endl;
	}
	return 0;
}
int judge(char a[81])
{
          int i,l;
          l=strlen(a);
          if((a[0]>='A'&&a[0]<='Z')||(a[0]>='a'&&a[0]<='z')||a[0]=='_')
          {
             for(i=1;i<l;i++)
             {
                          if((a[i]>='A'&&a[i]<='Z')||(a[i]>='a'&&a[i]<='z')||a[i]=='_'||(a[i]>='0'&&a[i]<='9')) continue;
                          else break;
             }
             if(i==l) return 1;
             else return 0;
          }
          else return 0;
}
int main()
{
    int n,x;
    int i;
    char a[81];
    scanf("%d\n",&n);
    for(i=0;i<n;i++)
    {
                    gets(a);
                    x=judge(a);
                    printf("%d\n",x);
    }
    getchar();
    getchar();
}
main()
{
    char a[800][80],b;
    int i,j,k,n;
    scanf("%d",&n); scanf("%c",&b);
    for (i=0;i<n;i++)
    {
        gets(a[i]);//scanf("%s",a[i]);
        if ((a[i][0]=='_')||((a[i][0]>='a')&&(a[i][0]<='z'))||((a[i][0]>='A')&&(a[i][0]<='Z')))
        {
            for (j=1;a[i][j]!='\0';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')))
                            continue ;
                            else
                           {
                                printf("0\n");break;
                           }
            }
            if (a[i][j]=='\0')
            printf("1\n");
        }
        else
        printf("0\n");
    }
}
main()
{
      int n,i,j,x,y=0;
      char str[85];
      scanf("%d",&n);
      getchar();
      for(i=0;i<n;i++)
      {
                gets(str);
                x=strlen(str);
                if(x>1&&(str[0]=='_'||(str[0]>64&&str[0]<91)||(str[0]>96&&str[0]<123)))
                {
                 for(j=1;j<x;j++)
                 {                 
                            if(str[j]=='_'||(str[j]>64&&str[j]<91)||(str[j]>96&&str[j]<123)||(str[j]>47&&str[j]<58))
                            y=1; 
                            else
                            {
                                y=0;   
                                break;
                             }                                  
                 }
                 }
                 else if(x==1&&(str[0]=='_'||(str[0]>64&&str[0]<91)||(str[0]>96&&str[0]<123)))
                 y=1;
                 if(y==0)                                          
                             printf("0\n");
                else
                printf("1\n");
                y=0;
      }
      }
main()
{
      int n,i;
      scanf("%d",&n);
      getchar();
      for(i=1;i<=n;i++)
      {
             char a[1000];
             int l,j,k;
            gets(a);
            l=strlen(a);
            if((a[0]>='A'&&a[0]<='Z')||a[0]=='_'||(a[0]>='a'&&a[0]<='z'))
            {
               for(k=1;k<l;k++)
              {
               if(a[k]>='A'&&a[k]<='Z');
               else if(a[k]>='0'&&a[k]<='9');
               else if(a[k]=='_');
               else if(a[k]>='a'&&a[k]<='z');                     
               else
                 break;
              }   
            
                       
      
              if(k==l)
              printf("1\n");
              else
               printf("0\n");
           }
           else
           printf("0\n"); 
           }               
}
int function1(char zimu)
{
    int panduan;
    panduan=zimu;
    if (((panduan>=65)&&(panduan<=90))||((panduan>=97)&&(panduan<=122))||(panduan==95)) return 1;//??????????? 
    else return 0;    
}//????????????? 
char function2(char zimu)
{
    int panduan;
    panduan=zimu;
    if (((panduan>=65)&&(panduan<=90))||((panduan>=97)&&(panduan<=122))||(panduan==95)||((panduan>=48)&&(panduan<=57))) return 1;//?????????????? 
    else return 0;//???????????????? 
}

int main()
{
    char str[81];
    int n,i,j,count,changdu,panduan;
    cin>>n;
    for(i=0;i<n;i++)
    {
                    cin.get();
                    count=0;
                    cin.get(str,81);
                    changdu=strlen(str);
                    if(changdu==0)cout<<" 0"<<endl;
                    else
                    {
                       for(j=0;j<changdu;j++)
                       {
                        if(j==0)
                        {
                                if(function1(str[j]))count++;
                        }
                        else
                        {
                                if(function2(str[j]))count++;
                        }
                       }
                       if(count==changdu && count!=0)cout<<"1"<<endl;//????????????? 
                       else cout<<"0"<<endl;
                    }
    }
cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();
return 0;
}
/*
 * assignment.cpp
 *
 *  Created on: 2010-11-23
 *      Author: ??
 *      ?????C????????
 */


int main() {
	int n, j = 1;
	cin>>n;
	char a[n + 1][100];
	for (int i = 0; i <= n; i++)
		cin.getline(a[i], 100);
	for (int i = 1; i <= n; i++) {
		
		//???????????
		if ((a[i][0] >= 'A' && a[i][0] <= 'Z') || (a[i][0] >= 'a' && a[i][0]
				<= 'z') || a[i][0] == '_') {
			
			//???????????????????
			j=1;
			while (a[i][j] != '\0') {
				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'))) {
					cout << "0" << endl;
					break;
				}
				j++;
			}
			if(a[i][j] == '\0')//???????1
			cout<<"1"<<endl;
		} else {//?????????0
			cout << "0" << endl;
		}
	}
	return 0;
}
int main()
{
  char s1[100];
  int i,j,n,len,s2[100];
  scanf("%d",&n);
  getchar();
  for(i=0;i<n;i++)
  {
     //scanf("%s",s1);
     //getchar();
     gets(s1);
     len=strlen(s1);
     for(j=0;j<len;j++)
     {
        if(j==0)
        {
          if(!((s1[j]>='a'&&s1[j]<='z')||(s1[j]=='_')||(s1[j]>='A'&&s1[j]<='Z')))
          {
            s2[i]=0;/*printf("0\n");*/
            break;
          }
        }
        else
        {
          if(!((s1[j]>='a'&&s1[j]<='z')||(s1[j]=='_')||(s1[j]>='A'&&s1[j]<='Z')||(s1[j]>='0'&&s1[j]<='9')))
           {
             s2[i]=0;
             break;
           }
        }
     }
     if(j>=len)
          s2[i]=1;
  }
  for(i=0;i<n;i++)
     printf("%d\n",s2[i]);
  return 0;    
}
int main()
{
    int n,i,temp;
    char s[1000][1000],*p;
    scanf ("%d\n",&n);
    for (i=0;i<n;i++)
    gets (s[i]);
    for (i=0;i<n;i++)
    {
        temp=0;
        p=&s[i][0];
        if (*p!='_' && isalpha(*p)==0)
        printf ("0\n");
        else
        {
            for (p=s[i]+1;*p!='\0';p++)
            {
                if (*p!='_' && isalpha(*p)==0 && isdigit(*p)==0)
                temp++;
            }
            if (temp!=0)
            printf ("0\n");
            if (temp==0)
            printf ("1\n");
            
        }
    }
    return 0;
}
//******************************
//* ????3.cpp              *
//* ?? 1000012747            *
//* ????????????? *
//******************************
int main()
{
	int n,m,len,i,t;        //??n,m??????????len???????i??????t??????????
	char a[100][80];        //?????????????
	cin>>n;
	cin.get();              //??????????
	m=n;
	while(m>0)
	{
		t=0;           //??????????t=0
		cin.getline(a[n-m],81,'\n');         //?????
		len=strlen(a[n-m]);                  //???????
		if ((a[n-m][0]=='_')||((a[n-m][0]>='A')&&(a[n-m][0]<='Z'))||((a[n-m][0]>='a')&&(a[n-m][0]<='z')))                  //????????
		{
			for(i=1;i<len;i++)
			{
				if ((a[n-m][i]=='_')||((a[n-m][i]>='A')&&(a[n-m][i]<='Z'))||((a[n-m][i]>='a')&&(a[n-m][i]<='z'))||((a[n-m][i]>='0')&&(a[n-m][i]<='9')))
					t++;               //????????????
			}
			if (t==len-1)
				cout<<1<<endl;
			else
				cout<<0<<endl;
		}
		else cout<<0<<endl;
		m--;
	}
	return 0;
}
int main()
{
	char *p[100];
	int i,j,n,m;
	scanf("%d\n",&n);
	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++)
	{
		m=1;
		if (!((*(*(p+i))>=65&&*(*(p+i))<=90)||(*(*(p+i))>=97&&*(*(p+i))<=122)||(*(*(p+i))=='_')))
			m=0;
		else
		{
			for (j=0;j<strlen(*(p+i));j++)
			{
				if (!((*(*(p+i)+j)>=65&&*(*(p+i)+j)<=90)||(*(*(p+i)+j)>=97&&*(*(p+i)+j)<=122)||(*(*(p+i)+j)=='_')||(*(*(p+i)+j)>=48&&*(*(p+i)+j)<=57)))
				{
					m=0;
					break;
				}
			}
		}
		printf("%d\n",m);
	}
	return 0;
}
int main()
{
 int n,i,j,k,len;
 char str[81];
 cin>>n;
 cin.get();
 for(i=1;i<=n;i++)
 {
  k=1;
  cin.getline(str,81,'\n');
  if(str[0]<'A'||(str[0]>'Z'&&str[0]<'_')||(str[0]>'_'&&str[0]<'a')||str[0]>'z')
   k=0;
  len=strlen(str);
  for(j=1;j<len;j++)
   if(str[j]<'0'||(str[j]>'9'&&str[j]<'A')||(str[j]>'Z'&&str[j]<'_')||(str[j]>'_'&&str[j]<'a')||str[j]>'z')
    {
     k=0;
     break;
    }
   cout<<k<<endl;
 }
 return 0;
}
int main()
{
	int n , i , flag[100] , j , len ;
	char c[81] ;
	cin >> n ;
	cin.get();
	for (i = 0 ; i < n ; i++)
	{	
		cin.getline(c,81) ;
		len = strlen(c) ;
		if (c[0] == '_' || (c[0] >= 'A' && c[0] <= 'Z') || (c[0] >= 'a' && c[0] <= 'z'))
		{	for (j = 1 ; j < len ; j++)
				if (c[j] != '_' && (c[j] < 'A' || (c[j] > 'Z' && c[j] < 'a') || c[j] > 'z') && ( c[j] < '0' || c[j] > '9'))
				{	flag[i] = 0 ;
					break ;
				}
			if ( j == len)	flag[i] = 1 ;
		}
		else flag[i] = 0 ;
		memset(c , 0 , sizeof(c)) ;
	}
	for (i = 0 ; i < n ; i++)
		cout << flag[i] << endl ;
	return 0 ;
}
int main()
{
    int num,i,sign;
    char vacab[100][100];
    cin>>num;
    int sum(char x[100]);
	cin.get();
    for(i=0;i<num;i++)
    {
       cin.getline(vacab[i],100);
       sign=sum(vacab[i]);
       if(sign==1)
       cout<<1<<endl;
       else
       cout<<0<<endl;
    }
    return 0;
}
int sum(char x[100])
{
        int j=0;int temp;
        j=0;
        if(x[0]=='_'||x[0]>='A'&&x[0]<='Z'||x[0]>='a'&&x[0]<='z')
        {
            while(x[j]!='\0')
            {
                if(x[j]=='_'||x[j]>='A'&&x[j]<='Z'||x[j]>='a'&&x[j]<='z'||x[j]>='0'&&x[j]<='9')
                {
                    temp=1;
                    j++;
                }
                else
                {
                    temp=0;
                    break;
                }
			}
        }
        else
        {
            temp=0;
        }
        return (temp);
}
void main()
{
	char *str[100],p[2];
	int i,j,n;
	scanf("%d",&n);
	gets(p);
	for(i=0;i<n;i++)
		str[i]=(char *)malloc(124*sizeof(char));
	for(i=0;i<n;i++)
		gets(str[i]);
	for(i=0;i<n;i++)
	{
		if(**(str+i)>='a'&&**(str+i)<='z'||**(str+i)>='A'&&**(str+i)<='Z'||**(str+i)=='_')
		{	
			for(j=0;*(*(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'))
					break;
			}
			if(*(*(str+i)+j)!='\0')printf("0\n");
			else printf("1\n");
		}
		else printf("0\n");
	}
}