//
//main.m
//test
//
//Created by mac on 16-3-1。
//版权(c ) 2016年_MyCompany_. All rights reserved。
//
#导入
#包含
#包含
#包含
静态常数char alphabetmhdbq=
' abcdefghijklmnopqrstuvwxyz '
' ABCDEFGHIJKLMNOPQRSTUVWXYZ '
' 0123456789 ';
staticconstintalphabetsize=sizeof (alphabet )- 1;
voidbruteimpl(char*str,int index,int maxDepth ) )。
{
for(intI=0; i alphabetSize; I )
{
str[index]=alphabet[i];
if(index==maxdepth-1 ) printf('%sn ',str );
ELSEbruteimpl(str,index hhdg,maxDepth );
}
}
语音队列(int maxlen )。
{
char*buf=malloc(Maxlenhhdg );
for(intI=1; i=maxLen I )
{
memset(buf,0,maxLen hhdg );
蓝牙impl (buf,0,I );
}
自由(buf );
}
staticconstintBUFFLEN=1024*100; voidbrute2(intmaxlen ) char*indices=malloc ) maxlen1); char*terminal=indices maxLen; char *打印缓冲区=malloc (bufflen ); char * pbend=print buff [ bufflen-1 ]; char * b=打印缓冲区; *pbend=' '; 索引[0]; char*p; wile(*terminal==0) )/printvaluefor ) p=indices; *p; p; for(--p; p=索引; -p () { *b =alphabet[*p-1]; if(b==pbend ) fwrite (打印缓冲区,1,B-打印缓冲区,stdout ); b=打印缓冲区; }}*b ='n '; if(b==pbend ) fwrite (打印缓冲区,1,B-打印缓冲区,stdout ); b=打印缓冲区; }//increment valuesintcarry=1; for(p; 卡莉; p )