<?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[Dreieck gespiegelt in der Konsole darstellen]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>mein Ziel ist ein Dreieck gespiegelt in der Konsole auszugeben</p>
<p>Für die normale Darstellung hab ich folgenden Code:</p>
<pre><code>int main( )
{  

int z;   cout&lt;&lt;&quot;z: &quot;; cin&gt;&gt;z;

for(int j=0; j&lt;z-1; j++ )cout&lt;&lt;&quot; &quot;; cout&lt;&lt;&quot;*&quot;&lt;&lt;endl;

for (int i=0;  i&lt;z-2;  i++)
{    for(int j=0; j&lt;z-i-2; j++) cout&lt;&lt;&quot; &quot;; cout&lt;&lt;&quot;*&quot;;
     for(int j=0; j&lt;2*i+1; j++) cout&lt;&lt;&quot; &quot;;
     cout&lt;&lt;&quot;*&quot;&lt;&lt;endl;
}
for (int i=0;  i&lt;z;  i++)cout&lt;&lt;&quot;* &quot;; cout&lt;&lt;endl;

return 0;
}
</code></pre>
<p>mit der Ausgabe:</p>
<pre><code>z: 5
    *
   * *
  *   *
 *     *
* * * * *
</code></pre>
<p>Nun möchte ich gerne, dass die Spitze nach unten zeigt. Ich habe die erste mit der letzten Schleife getauscht, allerdings komme ich im mittleren Teil nicht weiter. Man muss die Schleifen wohl rückwärts laufen lassen - daran scheitere ich im Moment.</p>
<p>Habt ihr vielleicht ein Hinweis für mich?</p>
<p>Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/313874/dreieck-gespiegelt-in-der-konsole-darstellen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 01 Aug 2026 20:57:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/313874.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 Feb 2013 17:27:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dreieck gespiegelt in der Konsole darstellen on Tue, 12 Feb 2013 17:27:42 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>mein Ziel ist ein Dreieck gespiegelt in der Konsole auszugeben</p>
<p>Für die normale Darstellung hab ich folgenden Code:</p>
<pre><code>int main( )
{  

int z;   cout&lt;&lt;&quot;z: &quot;; cin&gt;&gt;z;

for(int j=0; j&lt;z-1; j++ )cout&lt;&lt;&quot; &quot;; cout&lt;&lt;&quot;*&quot;&lt;&lt;endl;

for (int i=0;  i&lt;z-2;  i++)
{    for(int j=0; j&lt;z-i-2; j++) cout&lt;&lt;&quot; &quot;; cout&lt;&lt;&quot;*&quot;;
     for(int j=0; j&lt;2*i+1; j++) cout&lt;&lt;&quot; &quot;;
     cout&lt;&lt;&quot;*&quot;&lt;&lt;endl;
}
for (int i=0;  i&lt;z;  i++)cout&lt;&lt;&quot;* &quot;; cout&lt;&lt;endl;

return 0;
}
</code></pre>
<p>mit der Ausgabe:</p>
<pre><code>z: 5
    *
   * *
  *   *
 *     *
* * * * *
</code></pre>
<p>Nun möchte ich gerne, dass die Spitze nach unten zeigt. Ich habe die erste mit der letzten Schleife getauscht, allerdings komme ich im mittleren Teil nicht weiter. Man muss die Schleifen wohl rückwärts laufen lassen - daran scheitere ich im Moment.</p>
<p>Habt ihr vielleicht ein Hinweis für mich?</p>
<p>Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2298356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2298356</guid><dc:creator><![CDATA[locodice1]]></dc:creator><pubDate>Tue, 12 Feb 2013 17:27:42 GMT</pubDate></item><item><title><![CDATA[Reply to Dreieck gespiegelt in der Konsole darstellen on Tue, 12 Feb 2013 17:36:22 GMT]]></title><description><![CDATA[<p>im prinzip ganz einfach, die erste und die letze schleife vertauscht du<br />
(warum ist glaube ich klar, wenn nicht melde dich nochmal)<br />
bei dem inneren teil musst du die &quot;hauptschleife&quot; umdrehen, sodass sie runter zählt. also -- anstatt ++. dann noch schnell die bedingung, den anfangswert und dien vergleichoperator ändern und fertig <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>int z;   cout&lt;&lt;&quot;z: &quot;; cin&gt;&gt;z; 

for (int i=0;  i&lt;z;  i++)cout&lt;&lt;&quot;* &quot;; cout&lt;&lt;endl; 

for (int i=z-2;  i&gt;0;  i--) 
{    for(int j=0; j&lt;z-i-2; j++) cout&lt;&lt;&quot; &quot;; cout&lt;&lt;&quot;*&quot;; 
     for(int j=0; j&lt;2*i+1; j++) cout&lt;&lt;&quot; &quot;; 
     cout&lt;&lt;&quot;*&quot;&lt;&lt;endl; 
} 

for(int j=0; j&lt;z-1; j++ )cout&lt;&lt;&quot; &quot;; cout&lt;&lt;&quot;*&quot;&lt;&lt;endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2298358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2298358</guid><dc:creator><![CDATA[gamer8o4]]></dc:creator><pubDate>Tue, 12 Feb 2013 17:36:22 GMT</pubDate></item><item><title><![CDATA[Reply to Dreieck gespiegelt in der Konsole darstellen on Tue, 12 Feb 2013 17:35:27 GMT]]></title><description><![CDATA[<p>Besten Dank ! <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2298359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2298359</guid><dc:creator><![CDATA[locodice1]]></dc:creator><pubDate>Tue, 12 Feb 2013 17:35:27 GMT</pubDate></item></channel></rss>