<?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[Sätze Zufällig wählen]]></title><description><![CDATA[<p>hi jungs bin noch neu in sachen Programmieren</p>
<p>hab eine frage an euch und zwar<br />
wie kann ich Sätze Zufällig wählen ??</p>
<p>ich danke schon mal im vorraus für eure hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169729/sätze-zufällig-wählen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 19:40:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169729.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Jan 2007 12:19:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 12:19:21 GMT]]></title><description><![CDATA[<p>hi jungs bin noch neu in sachen Programmieren</p>
<p>hab eine frage an euch und zwar<br />
wie kann ich Sätze Zufällig wählen ??</p>
<p>ich danke schon mal im vorraus für eure hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205580</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205580</guid><dc:creator><![CDATA[NoName2054]]></dc:creator><pubDate>Mon, 08 Jan 2007 12:19:21 GMT</pubDate></item><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 12:21:16 GMT]]></title><description><![CDATA[<p>Du packst alle möglichen Sätze in ein Array (oder vector&lt;&gt;) und wählst dir per rand() einen aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205582</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 08 Jan 2007 12:21:16 GMT</pubDate></item><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 12:22:54 GMT]]></title><description><![CDATA[<p>was für sätze? strings? dann vielleicht alle in ein array und per zufall ein element ausgeben?</p>
<p>//edit: mist, zu spät ...</p>
<p>mfg,<br />
julian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205584</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205584</guid><dc:creator><![CDATA[Julian__]]></dc:creator><pubDate>Mon, 08 Jan 2007 12:22:54 GMT</pubDate></item><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 12:55:13 GMT]]></title><description><![CDATA[<p>kann einer vll. ein souce posten also nur wie das so ausehen sollte</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205608</guid><dc:creator><![CDATA[NoName2054]]></dc:creator><pubDate>Mon, 08 Jan 2007 12:55:13 GMT</pubDate></item><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 12:57:48 GMT]]></title><description><![CDATA[<p>Klar:</p>
<pre><code class="language-cpp">vector&lt;string&gt; texte;
//Vektor mit Daten füllen:
texte.push_back(&quot;Ich bin dumm.&quot;);
texte.push_back(&quot;Ich habe keine Ahnung von C++.&quot;);
...

//Satz zufällig auswählen und ausgeben:
cout&lt;&lt;texte[rand()%texte.size()]&lt;&lt;endl;
</code></pre>
<p>Und nun mach was draus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205610</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 08 Jan 2007 12:57:48 GMT</pubDate></item><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 13:42:46 GMT]]></title><description><![CDATA[<p>ich hab das jetzt mal so gemacht</p>
<pre><code>#include &lt;iostream&gt;
   #include &lt;vector&gt;
   #include &lt;conio.h&gt;
   using namespace std;

   int main() 
   {
   vector &lt;string&gt; texte;
//Vektor mit Daten füllen:
texte.push_back(&quot;F&quot;);
texte.push_back(&quot;D&quot;);
texte.push_back(&quot;F&quot;);
texte.push_back(&quot;A&quot;);

//Satz zufällig auswählen und ausgeben:
cout&lt;&lt;texte[rand()%texte.size()]&lt;&lt;endl;

   getch();
};
</code></pre>
<p>aber es kommt immer nur D raus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205644</guid><dc:creator><![CDATA[NoName2054]]></dc:creator><pubDate>Mon, 08 Jan 2007 13:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 13:47:10 GMT]]></title><description><![CDATA[<p>Dann schau dich mal ein bisschen hier um - hier im Board (und unter ANSI C) dürften schon mehr als genug Threads zum Thema rand() auf interessierte Leser warten.</p>
<p>PS: Und falls du hängen bleibst, such' mal nach &quot;srand()&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205649</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205649</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 08 Jan 2007 13:47:10 GMT</pubDate></item><item><title><![CDATA[Reply to Sätze Zufällig wählen on Mon, 08 Jan 2007 13:47:32 GMT]]></title><description><![CDATA[<p>Du hast</p>
<pre><code class="language-cpp">srand( time(NULL) );
</code></pre>
<p>vergessen. Musst den Generator aussäen, bevor du ihn das erste Mal verwendest. (Nur einmal)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1205652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1205652</guid><dc:creator><![CDATA[THX 1138]]></dc:creator><pubDate>Mon, 08 Jan 2007 13:47:32 GMT</pubDate></item></channel></rss>