字符串全排列输出
1 void Permutation(char* pStr, char* pBegin) 2 { 3 assert(pStr && pBegin); 4 5 if(*pBegin == '\0') 6 printf("%s\n",pStr); 7 else 8 { 9 for(char* pCh = pBegin; *pCh != '\0'; pCh++) 10 { 11 swap(*pBegin,*pCh); 12 Permutation(pStr, pBegin+1); 13 swap(*pBegin,*pCh); 14 } 15 } 16 }