<?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[Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bin ein Anfänger wenn es um die programmieren mit C++ geht, deswegen brauche ich etwas Hilfe bei meinem Programm <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>
<pre><code>#include&lt;stdio.h&gt;
#include&lt;cstdlib&gt;
#include&lt;time.h&gt;

int main(void)
{

	srand(time(NULL));

	int rb = rand() % 25 + 65;	// rb = Random Buchstabe
	for(int i=0;i &lt;= 26;i++)
	{
	int rb = rand() % 25 + 65;
	printf(&quot;%c&quot;,rb);
	getchar();
	}
	return 0;

}
</code></pre>
<p>Es geht darum, alle 26 Buchstaben des Alphabets in zufälliger Reihenfolge auszugeben (!ohne Wiederhohlungen!). Mein Problem hierbei ist, dass sich die Buchstaben wiederhohlen. Ich habe leider viel zu wenig Erfahrungen im Umgang mit C++ <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
<p>Ich hoffe ihr könnte mir helfen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>BTW: Dieses Programm soll ich im Auftrag von meinen Vater für das Stadt, Land, Fluss spielen programmieren.</p>
<p>MFG xJusT4FuN</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/330976/zufallsbuchstabe-26mal-ohne-wiederhohlung-ausgeben</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 02:32:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/330976.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Feb 2015 22:22:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Wed, 04 Feb 2015 22:22:24 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bin ein Anfänger wenn es um die programmieren mit C++ geht, deswegen brauche ich etwas Hilfe bei meinem Programm <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>
<pre><code>#include&lt;stdio.h&gt;
#include&lt;cstdlib&gt;
#include&lt;time.h&gt;

int main(void)
{

	srand(time(NULL));

	int rb = rand() % 25 + 65;	// rb = Random Buchstabe
	for(int i=0;i &lt;= 26;i++)
	{
	int rb = rand() % 25 + 65;
	printf(&quot;%c&quot;,rb);
	getchar();
	}
	return 0;

}
</code></pre>
<p>Es geht darum, alle 26 Buchstaben des Alphabets in zufälliger Reihenfolge auszugeben (!ohne Wiederhohlungen!). Mein Problem hierbei ist, dass sich die Buchstaben wiederhohlen. Ich habe leider viel zu wenig Erfahrungen im Umgang mit C++ <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
<p>Ich hoffe ihr könnte mir helfen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>BTW: Dieses Programm soll ich im Auftrag von meinen Vater für das Stadt, Land, Fluss spielen programmieren.</p>
<p>MFG xJusT4FuN</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2441261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441261</guid><dc:creator><![CDATA[xJusT4FuN]]></dc:creator><pubDate>Wed, 04 Feb 2015 22:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Wed, 04 Feb 2015 22:30:23 GMT]]></title><description><![CDATA[<pre><code>#include &lt;iostream&gt;
#include &lt;random&gt;
#include &lt;algorithm&gt;

int main()
{
    char arr[26];
    std::iota(arr, arr + sizeof arr, 'A');
    std::shuffle(arr, arr + sizeof arr, std::mt19937(std::random_device()()));
    std::cout.write(arr, sizeof arr);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2441263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441263</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Wed, 04 Feb 2015 22:30:23 GMT</pubDate></item><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Wed, 04 Feb 2015 22:33:02 GMT]]></title><description><![CDATA[<p>1. Mach eine Liste aller 26 Buchstaben.<br />
2. N = 25<br />
3. Zieh eine Zahl von 0 bis N.<br />
4. Gib den Buchstaben an der gewürfelten Stelle aus<br />
5. Tausche den Buchstaben mit dem N'ten Buchstaben in der Liste<br />
6. Wenn N = 0 -&gt; Fertig.<br />
Ansonsten:<br />
7. N = N - 1<br />
8. Zurück zu 3.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2441264</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441264</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 04 Feb 2015 22:33:02 GMT</pubDate></item><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Wed, 04 Feb 2015 22:37:41 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<pre><code>std::iota(arr, arr + sizeof arr, 'A');
</code></pre>
</blockquote>
<p>Wer garantiert dir, dass das funktioniert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2441266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441266</guid><dc:creator><![CDATA[EBCDIC]]></dc:creator><pubDate>Wed, 04 Feb 2015 22:37:41 GMT</pubDate></item><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Wed, 04 Feb 2015 23:15:51 GMT]]></title><description><![CDATA[<p>EBCDIC schrieb:</p>
<blockquote>
<p>Arcoth schrieb:</p>
<blockquote>
<pre><code>std::iota(arr, arr + sizeof arr, 'A');
</code></pre>
</blockquote>
<p>Wer garantiert dir, dass das funktioniert?</p>
</blockquote>
<p>Warum muss immer alles im Leben mit Garantien kommen, wenn's auch einfach nur funktionieren kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2441268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441268</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 04 Feb 2015 23:15:51 GMT</pubDate></item><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Wed, 04 Feb 2015 23:44:18 GMT]]></title><description><![CDATA[<p>#thuglife</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2441270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441270</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Wed, 04 Feb 2015 23:44:18 GMT</pubDate></item><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Thu, 05 Feb 2015 12:51:41 GMT]]></title><description><![CDATA[<p>Ich würde es so machen:</p>
<pre><code>#include &lt;iostream&gt; 
#include &lt;random&gt; 
#include &lt;algorithm&gt;
#include &lt;string&gt; 

int main() 
{ 
    std::string str{&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;}; 
    std::shuffle(str.begin(), str.end(), std::mt19937{std::random_device()()}); 
    std::copy(str.begin(), str.end(),std::ostream_iterator&lt;char&gt;{std::cout,&quot; &quot;});
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2441322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441322</guid><dc:creator><![CDATA[TNA]]></dc:creator><pubDate>Thu, 05 Feb 2015 12:51:41 GMT</pubDate></item><item><title><![CDATA[Reply to Zufallsbuchstabe - 26mal Ohne Wiederhohlung ausgeben on Sun, 08 Feb 2015 10:06:00 GMT]]></title><description><![CDATA[<p>Ja, ohne einen mit echter Entropie geseedeten Mersenne Twister wird das nichts mit dem shuffeln des Strings. :p<br />
*scnr*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2441763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2441763</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Sun, 08 Feb 2015 10:06:00 GMT</pubDate></item></channel></rss>