[過去ログ] 臨床統計もおもしろいですよ、その1 [無断転載禁止]©2ch.net (747レス)
上下前次1-新
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
724: 2018/09/24(月)21:05 ID:cwdsebwG(6/7) AAS
// Print all permutations of str in sorted order
void sortedPermutations(char str[])
{
// Get size of string
int size = strlen(str);
// Sort the string in increasing order
qsort(str, size, sizeof( str[0] ), compare);
// Print permutations one by one
bool isFinished = false;
while (!isFinished)
{
// print this permutation
static int x = 1;
printf("%d %s \n", x++, str);
// Find the rightmost character which is smaller than its next
// character. Let us call it 'first char'
int i;
for (i = size - 2; i >= 0; --i)
if (str[i] < str[i+1])
break;
上下前次1-新書関写板覧索設栞歴
あと 23 レスあります
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.327s*