<?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[Alle Zahlen ohne doppelte - 1234 bis 4321]]></title><description><![CDATA[<p>Hi</p>
<p>Ich habe für meine Mutter ein art magisches Quadrat am PC lösen wollen und dazu alle Zahlen von 1-9 in allen möglichen Kombinationen gebraucht, ohne das eine Ziffer doppelt vorkommt.</p>
<p>Gelöst habe ich das ganze recht aufwendig:</p>
<pre><code class="language-cpp">for( int i = 0; i &lt; 10; i++){
  for(int j = 0; j &lt; 10; j++){
    if(i==j) continue;
    for(int k = 0; k &lt; 10; k++){
      if(k==j||k==i) continue;
usw.
</code></pre>
<p>Das wird aber bei 9 verschiedenen Zahlen ziemlich hässlich.</p>
<p>Eine Alternative ist mir noch eingefallen, &quot;einfach&quot; eine Schleife von 0 bis 999999999 laufen lassen und ueberprüfen ob eine Ziffer doppelt vorkommt, aber wirklich schön finde ich auch das nicht, für 9 stellige Zahlen ist das aber durchaus noch machbar.</p>
<p>Hat jemand eine Idee wie das schöner gehen könnte?</p>
<p>Danke schonmal</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/280330/alle-zahlen-ohne-doppelte-1234-bis-4321</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 04:04:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/280330.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 13 Jan 2011 18:01:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Alle Zahlen ohne doppelte - 1234 bis 4321 on Thu, 13 Jan 2011 18:03:25 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Ich habe für meine Mutter ein art magisches Quadrat am PC lösen wollen und dazu alle Zahlen von 1-9 in allen möglichen Kombinationen gebraucht, ohne das eine Ziffer doppelt vorkommt.</p>
<p>Gelöst habe ich das ganze recht aufwendig:</p>
<pre><code class="language-cpp">for( int i = 0; i &lt; 10; i++){
  for(int j = 0; j &lt; 10; j++){
    if(i==j) continue;
    for(int k = 0; k &lt; 10; k++){
      if(k==j||k==i) continue;
usw.
</code></pre>
<p>Das wird aber bei 9 verschiedenen Zahlen ziemlich hässlich.</p>
<p>Eine Alternative ist mir noch eingefallen, &quot;einfach&quot; eine Schleife von 0 bis 999999999 laufen lassen und ueberprüfen ob eine Ziffer doppelt vorkommt, aber wirklich schön finde ich auch das nicht, für 9 stellige Zahlen ist das aber durchaus noch machbar.</p>
<p>Hat jemand eine Idee wie das schöner gehen könnte?</p>
<p>Danke schonmal</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006227</guid><dc:creator><![CDATA[Kessl]]></dc:creator><pubDate>Thu, 13 Jan 2011 18:03:25 GMT</pubDate></item><item><title><![CDATA[Reply to Alle Zahlen ohne doppelte - 1234 bis 4321 on Thu, 13 Jan 2011 18:16:52 GMT]]></title><description><![CDATA[<p>Da dürfte was mit Backtracking gehen:<br />
<a href="http://en.wikipedia.org/wiki/Backtracking" rel="nofollow">http://en.wikipedia.org/wiki/Backtracking</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006240</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 13 Jan 2011 18:16:52 GMT</pubDate></item><item><title><![CDATA[Reply to Alle Zahlen ohne doppelte - 1234 bis 4321 on Thu, 13 Jan 2011 18:49:25 GMT]]></title><description><![CDATA[<p>Gehts dir erstmal nur um die Permutationen von [1, 2, 3, 4, 5, 6, 7, 8, 9]? Siehe std::next_permutation.</p>
<p>Edit: Für das Lösen deines Problems solltest du dich dann allerdings an SeppJs Vorschlag halten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006255</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Thu, 13 Jan 2011 18:49:25 GMT</pubDate></item></channel></rss>