<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Kombinationen berechnen]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe ein kleines Problemchen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Sagen wir ich habe eine Zahl 3. Nun möchte ich alle Zahlenkombinationen aus dieser 3 haben, z.B:</p>
<p>1<br />
1,2<br />
1,3<br />
1,2,3<br />
2<br />
2,3<br />
3,1</p>
<p>Ich will das jede Kombinationen nur einmal vorkommt. Wenn ich schnon 1,2 habe, will ich nicht 2,1 haben. Wenn ich schon 1,2,3 habe will ich nicht 2,3,1 haben.</p>
<p>Die Reihenfolge ob 2,1 oder 1,2 ist egal.</p>
<p>Leider fehlt mir die Idee wie ich mir alle Kombinationen so wie ich sie haben will berechnen lassen kann.</p>
<p>Ich vermute mal das sind einige Schleifen in Schleifen, wobei ich auch denke das vielleicht Rekursion her muss. Bin mir aber nicht sicher.</p>
<p>Hat jemand eine Idee wie man dies einfach lösen könnte?</p>
<p>Phil</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/166354/kombinationen-berechnen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 11:24:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/166354.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Nov 2006 14:32:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kombinationen berechnen on Tue, 28 Nov 2006 19:22:43 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe ein kleines Problemchen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Sagen wir ich habe eine Zahl 3. Nun möchte ich alle Zahlenkombinationen aus dieser 3 haben, z.B:</p>
<p>1<br />
1,2<br />
1,3<br />
1,2,3<br />
2<br />
2,3<br />
3,1</p>
<p>Ich will das jede Kombinationen nur einmal vorkommt. Wenn ich schnon 1,2 habe, will ich nicht 2,1 haben. Wenn ich schon 1,2,3 habe will ich nicht 2,3,1 haben.</p>
<p>Die Reihenfolge ob 2,1 oder 1,2 ist egal.</p>
<p>Leider fehlt mir die Idee wie ich mir alle Kombinationen so wie ich sie haben will berechnen lassen kann.</p>
<p>Ich vermute mal das sind einige Schleifen in Schleifen, wobei ich auch denke das vielleicht Rekursion her muss. Bin mir aber nicht sicher.</p>
<p>Hat jemand eine Idee wie man dies einfach lösen könnte?</p>
<p>Phil</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1183112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1183112</guid><dc:creator><![CDATA[PvdB]]></dc:creator><pubDate>Tue, 28 Nov 2006 19:22:43 GMT</pubDate></item><item><title><![CDATA[Reply to Kombinationen berechnen on Tue, 28 Nov 2006 14:37:35 GMT]]></title><description><![CDATA[<p>Das gibt dir alle Permutationen:</p>
<p><a href="http://www.sgi.com/tech/stl/next_permutation.html" rel="nofollow">http://www.sgi.com/tech/stl/next_permutation.html</a></p>
<p>die musst dann noch um die symetrischen ausdünnen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1183117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1183117</guid><dc:creator><![CDATA[__HIRSCH_H__]]></dc:creator><pubDate>Tue, 28 Nov 2006 14:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to Kombinationen berechnen on Tue, 28 Nov 2006 14:43:57 GMT]]></title><description><![CDATA[<p>Oder von 0 bis 2^n (n Anzahl der Teile) zählen. Das i-te Bit sagt, ob Zahl i dabei ist oder nicht. Funktioniert aber nur, wenn alle Zahlen verschieden sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1183120</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1183120</guid><dc:creator><![CDATA[Jester]]></dc:creator><pubDate>Tue, 28 Nov 2006 14:43:57 GMT</pubDate></item><item><title><![CDATA[Reply to Kombinationen berechnen on Tue, 28 Nov 2006 19:46:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">int Test[32];

void Print(int i)
{
	int a;
	for(a=0;a&lt;i;a++)
		printf(a+1&lt;i?&quot;%d,&quot;:&quot;%d&quot;,Test[a]);
	printf(&quot;\n&quot;);
}

void Kombi(int a,int pt)
{
	while(a&gt;0)
	{
		Test[pt]=a;
		Print(pt+1);
		Kombi(--a,pt+1);
	}
}

int main(int argc, char* argv[])
{
	Kombi(7,0);
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1183360</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1183360</guid><dc:creator><![CDATA[rapso]]></dc:creator><pubDate>Tue, 28 Nov 2006 19:46:22 GMT</pubDate></item></channel></rss>