<?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[unbekanntes Problem]]></title><description><![CDATA[<p>Das Programm funktioniert, (es soll alle Primzahlprodukte mit 3 Primzahlen bis zu einem bestimmten Wert raussuchen.)</p>
<p>wenn ich 10000 als Wert eingebe, sucht er erst alle 500 raus, schweigt eine weile und produziert dann folgendes:</p>
<pre><code>Nr.: 496 (449 * 7 * 3= 9429)
Nr.: 497 (457 * 7 * 3= 9597)
Nr.: 498 (461 * 7 * 3= 9681)
Nr.: 499 (463 * 7 * 3= 9723)
Nr.: 500 (467 * 7 * 3= 9807)
Nr.: 501 (1297 * 1291 * 1283= -2146677455)
Nr.: 502 (1297 * 1291 * 1289= -2136630893)
Nr.: 503 (1301 * 1289 * 1283= -2143390409)
Nr.: 504 (1301 * 1291 * 1279= -2146770407)
</code></pre>
<p>Es ist ein einfaches Programm. Bei bedarf poste ich es.</p>
<p>Das ist die Bedingung:</p>
<pre><code>if (a*c*e&lt;=limit &amp;&amp; a!=c &amp;&amp; a!=e &amp;&amp; e!=c &amp;&amp; a&gt;1 &amp;&amp; c&gt;1 &amp;&amp; e&gt;1)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/267842/unbekanntes-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 07:02:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/267842.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 31 May 2010 11:08:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to unbekanntes Problem on Mon, 31 May 2010 11:08:54 GMT]]></title><description><![CDATA[<p>Das Programm funktioniert, (es soll alle Primzahlprodukte mit 3 Primzahlen bis zu einem bestimmten Wert raussuchen.)</p>
<p>wenn ich 10000 als Wert eingebe, sucht er erst alle 500 raus, schweigt eine weile und produziert dann folgendes:</p>
<pre><code>Nr.: 496 (449 * 7 * 3= 9429)
Nr.: 497 (457 * 7 * 3= 9597)
Nr.: 498 (461 * 7 * 3= 9681)
Nr.: 499 (463 * 7 * 3= 9723)
Nr.: 500 (467 * 7 * 3= 9807)
Nr.: 501 (1297 * 1291 * 1283= -2146677455)
Nr.: 502 (1297 * 1291 * 1289= -2136630893)
Nr.: 503 (1301 * 1289 * 1283= -2143390409)
Nr.: 504 (1301 * 1291 * 1279= -2146770407)
</code></pre>
<p>Es ist ein einfaches Programm. Bei bedarf poste ich es.</p>
<p>Das ist die Bedingung:</p>
<pre><code>if (a*c*e&lt;=limit &amp;&amp; a!=c &amp;&amp; a!=e &amp;&amp; e!=c &amp;&amp; a&gt;1 &amp;&amp; c&gt;1 &amp;&amp; e&gt;1)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1904843</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904843</guid><dc:creator><![CDATA[Bekell]]></dc:creator><pubDate>Mon, 31 May 2010 11:08:54 GMT</pubDate></item><item><title><![CDATA[Reply to unbekanntes Problem on Mon, 31 May 2010 11:15:10 GMT]]></title><description><![CDATA[<p>Bekell schrieb:</p>
<blockquote>
<p>Bei bedarf poste ich es.</p>
<p>Das ist die Bedingung:</p>
<pre><code>if (a*c*e&lt;=limit &amp;&amp; a!=c &amp;&amp; a!=e &amp;&amp; e!=c &amp;&amp; a&gt;1 &amp;&amp; c&gt;1 &amp;&amp; e&gt;1)
</code></pre>
</blockquote>
<p>Du brichst scheinbar die Schleife in der das alles läuft nicht ab. Vermutlich inkrementierst du irgendeine Zahl, prüfst ob sie kleiner als 10000 ist und gibst die primfaktoren aus, falls das der Fall ist.<br />
Du brichst aber scheinbar nicht ab, wenn die Zahl größer als 10000 ist, sondern inkrementierst solange weiter bis du einen overrun hast und die Zahl durch das Inkrementieren negativ wird. Und dann ist sie ja wieder kleiner als 10000...</p>
<p>Aber das ist alles nur spekulation solang du uns nicht deinen Code zeigst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904848</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 31 May 2010 11:15:10 GMT</pubDate></item><item><title><![CDATA[Reply to unbekanntes Problem on Mon, 31 May 2010 11:15:30 GMT]]></title><description><![CDATA[<p>Und was ist jetzt dein Problem? Die negativen Zahlen sind ein Integer-Überlauf. Nimm einen größeren Datentyp.</p>
<p>Oder ist die Frage, warum es von 467 * 7 * 3 zu 1297 * 1291 * 1283 springt? Dazu müsste man dein Programm sehen.</p>
<p>Bekell schrieb:</p>
<blockquote>
<p>Das ist die Bedingung:</p>
<pre><code>if (a*c*e&lt;=limit &amp;&amp; a!=c &amp;&amp; a!=e &amp;&amp; e!=c &amp;&amp; a&gt;1 &amp;&amp; c&gt;1 &amp;&amp; e&gt;1)
</code></pre>
</blockquote>
<p>Glaubst du ernsthaft, dass das irgendwie nützlich ist? Falls diese Zeile repräsentativ für dein Programm ist, brauchst du uns auch gar nicht den Rest des Programms zu zeigen. Das würde sich niemand durchlesen und jeder würde dich auffordern, das Programm nochmal neu zu schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904849</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 31 May 2010 11:15:30 GMT</pubDate></item><item><title><![CDATA[Reply to unbekanntes Problem on Mon, 31 May 2010 11:17:20 GMT]]></title><description><![CDATA[<ul>
<li></li>
</ul>
]]></description><link>https://www.c-plusplus.net/forum/post/1904851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904851</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Mon, 31 May 2010 11:17:20 GMT</pubDate></item><item><title><![CDATA[Reply to unbekanntes Problem on Mon, 31 May 2010 11:17:04 GMT]]></title><description><![CDATA[<p>Die Multiplikation a*c*e führt zu einem Integer-Überlauf. Das Ergebnis ist dann negativ (mach einfach mal ein <code>cout &lt;&lt; 1301 * 1291 * 1279</code> , dann siehst du, was ich meine). -2146770407 ist aber wie gefordert kleiner als 1000. In deinem Fall dürfte die Umstellung auf <code>unsigned</code> helfen (1301u * 1291u * 1279u == 2148196889), wenn es da aber auch zum Überlauf kommt, musst du den gegebenenfalls abfangen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904852</guid><dc:creator><![CDATA[ipsec]]></dc:creator><pubDate>Mon, 31 May 2010 11:17:04 GMT</pubDate></item><item><title><![CDATA[Reply to unbekanntes Problem on Mon, 31 May 2010 11:32:14 GMT]]></title><description><![CDATA[<p>Ja, das mit dem Überlauf ist richtig. Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904861</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904861</guid><dc:creator><![CDATA[Bekell]]></dc:creator><pubDate>Mon, 31 May 2010 11:32:14 GMT</pubDate></item></channel></rss>