<?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[Mein Diamand]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe hier ein programm gemacht das einen user nach wieviel reihen und welches character es benutzen soll.</p>
<p>What size do you want? 5<br />
What character do you want? 1</p>
<p>1<br />
11<br />
111<br />
1111<br />
11111<br />
1111<br />
111<br />
11<br />
1</p>
<p>Nur leider steh ich auf dem Kriegsfuss und es möchte einfach nicht funktioniern, kann mir jemand helfen, bitte?</p>
<p>Source:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
    char character;
	int size;
	int rows = 0;
	int x;

	cout &lt;&lt;&quot;What size do you want?&quot;;
	cin &gt;&gt; size;

	if (size &lt; 1)
	{
		cout &lt;&lt;&quot;Not enough size&quot;;
		system (&quot;pause&quot;);
		return 0;
	}

	cout &lt;&lt;&quot;What character do you want?&quot;;
	cin &gt;&gt; character;

	while( rows &lt; (size * 2) - 1 )
	{
		if( rows &lt; size ) // draw the top half of the diamond
		{
			for( x = 0; x &lt; size - rows; x++ )
				cout &lt;&lt; ' '; // the space before

			for( x = 0; x &lt; rows + 1; x++ )
				cout &lt;&lt; character;

		}
		else // draw the bottom half of the diamond
		{
			for( x = 0; x &lt; rows - size; x++ )
				cout &lt;&lt; ' '; // the space before

			for( x = 0; x &lt; ((size * 2)) - (rows - size); x++ )

			cout &lt;&lt; character;
		}
        if (rows &lt; size)
		{
		for (x = 0; x &lt; rows - size; x++)
				cout &lt;&lt; ' ';

		for (x = 0; x &lt; rows; x++)

        cout &lt;&lt; character;

		}
		cout &lt;&lt; endl;
		rows = rows + 1;
	}

	system (&quot;pause&quot;);
    return 0;
}
</code></pre>
<p>Ist mit Visual C++ 2005 gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146557/mein-diamand</link><generator>RSS for Node</generator><lastBuildDate>Thu, 03 Sep 2026 19:27:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146557.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 May 2006 18:37:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mein Diamand on Mon, 08 May 2006 18:37:33 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe hier ein programm gemacht das einen user nach wieviel reihen und welches character es benutzen soll.</p>
<p>What size do you want? 5<br />
What character do you want? 1</p>
<p>1<br />
11<br />
111<br />
1111<br />
11111<br />
1111<br />
111<br />
11<br />
1</p>
<p>Nur leider steh ich auf dem Kriegsfuss und es möchte einfach nicht funktioniern, kann mir jemand helfen, bitte?</p>
<p>Source:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
    char character;
	int size;
	int rows = 0;
	int x;

	cout &lt;&lt;&quot;What size do you want?&quot;;
	cin &gt;&gt; size;

	if (size &lt; 1)
	{
		cout &lt;&lt;&quot;Not enough size&quot;;
		system (&quot;pause&quot;);
		return 0;
	}

	cout &lt;&lt;&quot;What character do you want?&quot;;
	cin &gt;&gt; character;

	while( rows &lt; (size * 2) - 1 )
	{
		if( rows &lt; size ) // draw the top half of the diamond
		{
			for( x = 0; x &lt; size - rows; x++ )
				cout &lt;&lt; ' '; // the space before

			for( x = 0; x &lt; rows + 1; x++ )
				cout &lt;&lt; character;

		}
		else // draw the bottom half of the diamond
		{
			for( x = 0; x &lt; rows - size; x++ )
				cout &lt;&lt; ' '; // the space before

			for( x = 0; x &lt; ((size * 2)) - (rows - size); x++ )

			cout &lt;&lt; character;
		}
        if (rows &lt; size)
		{
		for (x = 0; x &lt; rows - size; x++)
				cout &lt;&lt; ' ';

		for (x = 0; x &lt; rows; x++)

        cout &lt;&lt; character;

		}
		cout &lt;&lt; endl;
		rows = rows + 1;
	}

	system (&quot;pause&quot;);
    return 0;
}
</code></pre>
<p>Ist mit Visual C++ 2005 gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053691</guid><dc:creator><![CDATA[le-invisiware]]></dc:creator><pubDate>Mon, 08 May 2006 18:37:33 GMT</pubDate></item><item><title><![CDATA[Reply to Mein Diamand on Tue, 09 May 2006 06:57:39 GMT]]></title><description><![CDATA[<p>Gegenfrage: Wie äußert sich dieses &quot;möchte nicht funktionieren&quot;? Compilerfehler? Falsche Ausgaben?</p>
<p>Was mir auf Anhieb auffällt: Du hast zweimal den Block &quot;if(rows&lt;size)&quot;. Und anstelle der while-Schleife könntest du auch ein for() verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053867</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053867</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 09 May 2006 06:57:39 GMT</pubDate></item><item><title><![CDATA[Reply to Mein Diamand on Tue, 09 May 2006 14:38:48 GMT]]></title><description><![CDATA[<p>warum so viele for's if's und while's?<br />
reicht nicht:</p>
<pre><code class="language-cpp">// Anzahl und Zeich vom Benutzer einlesen
   cin &gt;&gt; size;
   cin &gt;&gt; character;

   // vorwärts
   for( int i=0; i&lt;size; i++)
   {
      for( int k=0; k&lt;i; k++)
         cout &lt;&lt; character;
      cout &lt;&lt; endl;
   }
   // rückwärts
   for( ; i&gt;0; i--)
   {
      for( int k=0; k&lt;i; k++)
         cout &lt;&lt; character;
      cout &lt;&lt; endl;
   }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1054208</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054208</guid><dc:creator><![CDATA[fdsa]]></dc:creator><pubDate>Tue, 09 May 2006 14:38:48 GMT</pubDate></item><item><title><![CDATA[Reply to Mein Diamand on Thu, 11 May 2006 10:42:40 GMT]]></title><description><![CDATA[<p>kann der herr vielleicht vorher mal sagen was nicht haut!<br />
for/ if/ while... was ein gewusel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1055462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1055462</guid><dc:creator><![CDATA[HaCroo]]></dc:creator><pubDate>Thu, 11 May 2006 10:42:40 GMT</pubDate></item><item><title><![CDATA[Reply to Mein Diamand on Thu, 11 May 2006 16:34:21 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=2822" rel="nofollow">SideWinder</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=13" rel="nofollow">DOS und Win32-Konsole</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1055818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1055818</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 11 May 2006 16:34:21 GMT</pubDate></item></channel></rss>