<?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[übung aus volkards c++ kurs]]></title><description><![CDATA[<p>hallo zusammen, kann mir jmnd. sagen wieso ich keine Ausgabe bekomme?<br />
*rumtroll*<br />
ich blicks nich...</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;string&gt;
#include&lt;cstdlib&gt;
#include&lt;ctime&gt;
using namespace std;
void mischen(int kartendeck[4][13])

{
   int farbe, zahl;
   for(int karte = 1; karte &lt;=52; karte++)
   {
      do
      {
         farbe = rand() % 4;
         zahl = rand() % 13;
      }
      while(kartendeck[farbe][zahl] != 0);
      kartendeck[farbe][zahl] = karte;
   }
}
void austeilen(const int kartendeck[4][13],
               const string farbe[4],
               const string zahl[13])
{
   for(int karte=1; karte&lt;=52;karte++)
      for(int i=0;i&lt;4;i++)
         for(int j=0;j&lt;13;j++)
            if(kartendeck[4][13]==karte)
               cout&lt;&lt; farbe[i] &lt;&lt;&quot; &quot;&lt;&lt;zahl[j]&lt;&lt;endl;

}
int main()
{
   const string Farben[4] = { &quot;Kreuz&quot;, &quot;Pik&quot;, &quot;Herz&quot;, &quot;Karo&quot; };
   const string Zahlen[13] = { &quot;As&quot;, &quot;Koenig&quot;, &quot;Dame&quot;, &quot;Bube&quot;, &quot;Zehn&quot;,
      &quot;Neun&quot;, &quot;Acht&quot;, &quot;Sieben&quot;, &quot;Sechs&quot;,
      &quot;Fuenf&quot;, &quot;Vier&quot;, &quot;Drei&quot;, &quot;Zwei&quot; };
   int Kartendeck[4][13] = { 0 };
   srand(time(0));
   mischen(Kartendeck);
   austeilen(Kartendeck, Farben, Zahlen);

   cout&lt;&lt;&quot;Bitte druecken Sie Return. . .&quot;;
   getchar();
   return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/224885/übung-aus-volkards-c-kurs</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 03:29:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/224885.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Oct 2008 11:00:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to übung aus volkards c++ kurs on Thu, 16 Oct 2008 11:00:39 GMT]]></title><description><![CDATA[<p>hallo zusammen, kann mir jmnd. sagen wieso ich keine Ausgabe bekomme?<br />
*rumtroll*<br />
ich blicks nich...</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;string&gt;
#include&lt;cstdlib&gt;
#include&lt;ctime&gt;
using namespace std;
void mischen(int kartendeck[4][13])

{
   int farbe, zahl;
   for(int karte = 1; karte &lt;=52; karte++)
   {
      do
      {
         farbe = rand() % 4;
         zahl = rand() % 13;
      }
      while(kartendeck[farbe][zahl] != 0);
      kartendeck[farbe][zahl] = karte;
   }
}
void austeilen(const int kartendeck[4][13],
               const string farbe[4],
               const string zahl[13])
{
   for(int karte=1; karte&lt;=52;karte++)
      for(int i=0;i&lt;4;i++)
         for(int j=0;j&lt;13;j++)
            if(kartendeck[4][13]==karte)
               cout&lt;&lt; farbe[i] &lt;&lt;&quot; &quot;&lt;&lt;zahl[j]&lt;&lt;endl;

}
int main()
{
   const string Farben[4] = { &quot;Kreuz&quot;, &quot;Pik&quot;, &quot;Herz&quot;, &quot;Karo&quot; };
   const string Zahlen[13] = { &quot;As&quot;, &quot;Koenig&quot;, &quot;Dame&quot;, &quot;Bube&quot;, &quot;Zehn&quot;,
      &quot;Neun&quot;, &quot;Acht&quot;, &quot;Sieben&quot;, &quot;Sechs&quot;,
      &quot;Fuenf&quot;, &quot;Vier&quot;, &quot;Drei&quot;, &quot;Zwei&quot; };
   int Kartendeck[4][13] = { 0 };
   srand(time(0));
   mischen(Kartendeck);
   austeilen(Kartendeck, Farben, Zahlen);

   cout&lt;&lt;&quot;Bitte druecken Sie Return. . .&quot;;
   getchar();
   return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1599860</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1599860</guid><dc:creator><![CDATA[carsten.]]></dc:creator><pubDate>Thu, 16 Oct 2008 11:00:39 GMT</pubDate></item><item><title><![CDATA[Reply to übung aus volkards c++ kurs on Thu, 16 Oct 2008 11:02:45 GMT]]></title><description><![CDATA[<p>Weil du in &quot;mischen&quot; in der do-while-Schleife solange durchläufst bist du per Zufall ein Element findest das nicht 0 ist. Aber du hast zuvor in der main alle mit 0 initialisiert und seitdem nicht mehr verändert =&gt; Endlosschleife</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1599862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1599862</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Thu, 16 Oct 2008 11:02:45 GMT</pubDate></item><item><title><![CDATA[Reply to übung aus volkards c++ kurs on Thu, 16 Oct 2008 11:51:41 GMT]]></title><description><![CDATA[<p>ouch.... danke^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1599885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1599885</guid><dc:creator><![CDATA[carsten.]]></dc:creator><pubDate>Thu, 16 Oct 2008 11:51:41 GMT</pubDate></item><item><title><![CDATA[Reply to übung aus volkards c++ kurs on Thu, 16 Oct 2008 12:42:28 GMT]]></title><description><![CDATA[<p>Nö, er läuft doch durch, SOLANGE das gefundene Element ungleich 0 ist ...</p>
<p>Und ... bei mir erzeugt der Code eine Ausgabe - ohne Änderung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1599917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1599917</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Thu, 16 Oct 2008 12:42:28 GMT</pubDate></item><item><title><![CDATA[Reply to übung aus volkards c++ kurs on Thu, 16 Oct 2008 12:49:55 GMT]]></title><description><![CDATA[<p>Ah, stimmt, versehen. Liegt dann wohl eher an<br />
if(kartendeck[4][13]==karte)<br />
das sollte wo so aussehen:<br />
if(kartendeck[i][j]==karte)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1599925</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1599925</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Thu, 16 Oct 2008 12:49:55 GMT</pubDate></item><item><title><![CDATA[Reply to übung aus volkards c++ kurs on Thu, 16 Oct 2008 12:55:34 GMT]]></title><description><![CDATA[<p>Kann auch nicht sein ... wie gesagt, so wie der Code geschrieben ist, krieg ich auch eine Ausgabe, allerdings sind die Karten natürlich nicht gemischt, wegen der von Dir erwähnten Code-Stelle. Mit Deiner Änderung kommen die Karten dann auch (wie wohl gewünscht) gemischt heraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1599927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1599927</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Thu, 16 Oct 2008 12:55:34 GMT</pubDate></item><item><title><![CDATA[Reply to übung aus volkards c++ kurs on Thu, 16 Oct 2008 14:03:31 GMT]]></title><description><![CDATA[<p>Da er mit if(kartendeck[4][13]==karte) außerhalb der Speichergrenzen herumwuselt, ist das Verhalten eh nicht bestimmt. Wer weiß was für Einstellungen etc. er hat, daß ihm das um die Ohren fliegt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1599962</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1599962</guid><dc:creator><![CDATA[Fellhuhn]]></dc:creator><pubDate>Thu, 16 Oct 2008 14:03:31 GMT</pubDate></item></channel></rss>