<?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[wiedermal lotto...]]></title><description><![CDATA[<p>hallo zusammen</p>
<pre><code class="language-cpp">/*#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;*/
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;ctime&gt;
#include &lt;string&gt;
using namespace std; 

int main()

{
	int zufallszahl, i;
	int array[] = {0,0,0,0,0,0};

	char n;

	do
	{

		cout &lt;&lt; &quot;wollen Sie Lotto spielen dann druecken Sie die j fuer ja&quot;&lt;&lt;endl;
		cout &lt;&lt; &quot;wollen Sie aufhoeren druecken Sie eine eine beliebige Taste ausser j&quot;&lt;&lt;endl;

		cin &gt;&gt; n ;

		if (n == 'j')
		{

			srand( time(0) );

		for (i=0;i&lt;6;i++)
		{

			zufallszahl = rand() % 50 + 1;

			if (zufallszahl == array[0] || zufallszahl == array[1] || zufallszahl == array[2]  || zufallszahl == array[3] || zufallszahl == array[4] || zufallszahl == array[5])

				i--;

			else

				cout &lt;&lt; zufallszahl &lt;&lt; endl;
				array[i]=zufallszahl;
				//cout &lt;&lt; &quot;array&quot; &lt;&lt; array[i] &lt;&lt; endl;

		}

		}
		else;
	}
	while (n =='j');
	return 0;
}
</code></pre>
<p>trotz meiner if bediengung, wo die zufallszahl mit den arraywerten verglichen wird, bekomm ich ab und zu gleiche zahlen raus.<br />
hab ich was übersehn?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/200167/wiedermal-lotto</link><generator>RSS for Node</generator><lastBuildDate>Sun, 04 Oct 2026 10:04:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200167.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Dec 2007 13:56:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to wiedermal lotto... on Tue, 11 Dec 2007 13:56:26 GMT]]></title><description><![CDATA[<p>hallo zusammen</p>
<pre><code class="language-cpp">/*#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;*/
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;ctime&gt;
#include &lt;string&gt;
using namespace std; 

int main()

{
	int zufallszahl, i;
	int array[] = {0,0,0,0,0,0};

	char n;

	do
	{

		cout &lt;&lt; &quot;wollen Sie Lotto spielen dann druecken Sie die j fuer ja&quot;&lt;&lt;endl;
		cout &lt;&lt; &quot;wollen Sie aufhoeren druecken Sie eine eine beliebige Taste ausser j&quot;&lt;&lt;endl;

		cin &gt;&gt; n ;

		if (n == 'j')
		{

			srand( time(0) );

		for (i=0;i&lt;6;i++)
		{

			zufallszahl = rand() % 50 + 1;

			if (zufallszahl == array[0] || zufallszahl == array[1] || zufallszahl == array[2]  || zufallszahl == array[3] || zufallszahl == array[4] || zufallszahl == array[5])

				i--;

			else

				cout &lt;&lt; zufallszahl &lt;&lt; endl;
				array[i]=zufallszahl;
				//cout &lt;&lt; &quot;array&quot; &lt;&lt; array[i] &lt;&lt; endl;

		}

		}
		else;
	}
	while (n =='j');
	return 0;
}
</code></pre>
<p>trotz meiner if bediengung, wo die zufallszahl mit den arraywerten verglichen wird, bekomm ich ab und zu gleiche zahlen raus.<br />
hab ich was übersehn?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418753</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418753</guid><dc:creator><![CDATA[snoopy9134]]></dc:creator><pubDate>Tue, 11 Dec 2007 13:56:26 GMT</pubDate></item><item><title><![CDATA[Reply to wiedermal lotto... on Tue, 11 Dec 2007 14:06:09 GMT]]></title><description><![CDATA[<p>Vielleicht solltest du die beiden Anweisungen hinter dem else zu einer Compound-Anweisung klammern - so wie das Programm jetzt dasteht, wird nur die Ausgabe von dem if-else erfasst und nicht das Eintragen in dein Array.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418771</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418771</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:06:09 GMT</pubDate></item><item><title><![CDATA[Reply to wiedermal lotto... on Tue, 11 Dec 2007 14:16:53 GMT]]></title><description><![CDATA[<p>danke fürn tipp, jetzt funzt alles!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418780</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418780</guid><dc:creator><![CDATA[snoopy9134]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:16:53 GMT</pubDate></item></channel></rss>