<?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[Kleines Problem]]></title><description><![CDATA[<p>Ich will grad ein kleines Programm machen was den Flächeninhalt und das Volumen von unterschiedlichen Körpern etc. berechnet.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
      cout&lt;&lt;&quot;*******************************************************************************&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;*                       Volumen und Flaechenberechnung                        *&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;*******************************************************************************\n\n&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;Flaecheninhalt\n&quot;;
      cout&lt;&lt;&quot;[1]Rechtwinkliges Dreieck\n&quot;;
      cout&lt;&lt;&quot;[2]Allgemeines Viereck\n&quot;;
      cout&lt;&lt;&quot;[3]Trapez\n&quot;;
      cout&lt;&lt;&quot;[4]Parallelogramm\n&quot;;
      cout&lt;&lt;&quot;[5]Drachenviereck\n&quot;;
      cout&lt;&lt;&quot;[6]Rechteck\n&quot;;
      cout&lt;&lt;&quot;[7]Kreis\n&quot;;
      cout&lt;&lt;&quot;[8]Quadrat\n&quot;;
      cout&lt;&lt;&quot;\nVolumen\n&quot;;
      cout&lt;&lt;&quot;[9]Wuerfel\n&quot;;
      cout&lt;&lt;&quot;[10]Quader\n&quot;;
      cout&lt;&lt;&quot;[11]Prisma\n&quot;;
      cout&lt;&lt;&quot;[12]Kreiszylinder\n&quot;;
      cout&lt;&lt;&quot;[13]Pyramide\n&quot;;
      cout&lt;&lt;&quot;[14]Kreiskegel\n&quot;;
      cout&lt;&lt;&quot;[15]Kugel\n&quot;;
      cout&lt;&lt;&quot;\nBitte waehlen Sie!\n&quot;;
      float Wahl;
      cin&gt;&gt;Wahl;
      {
                          if (Wahl==1)
                          cout&lt;&lt;&quot;Bitte geben Sie die erste Kathede ein:\n&quot;;
                          double a;
                          cin&gt;&gt;a;
                          cout&lt;&lt;&quot;Bitte geben Sie die zweite Kathede ein:\n&quot;;
                          double b;
                          cin&gt;&gt;b;
                          double A;
                          A=(a*b)/2;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;A&lt;&lt;&quot;\n&quot;;
      }
      {
                          if (Wahl==4)
                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des ersten Dreiecks ein:\n&quot;;
                          double c;
                          cin&gt;&gt;c;
                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des zweiten Dreiecks ein:\n&quot;;
                          double d;
                          cin&gt;&gt;d;
                          double B;
                          B=c+d;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;B&lt;&lt;&quot;\n&quot;;
      }

      system (&quot;Pause&quot;);
}
</code></pre>
<p>Leider funktioniert es nicht und ich weiß net warum. Wenn ich z.B. 2 eingebe dann kommt trotzdem 1 warum???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/122001/kleines-problem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 23:39:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/122001.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Sep 2005 12:05:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kleines Problem on Thu, 29 Sep 2005 12:05:14 GMT]]></title><description><![CDATA[<p>Ich will grad ein kleines Programm machen was den Flächeninhalt und das Volumen von unterschiedlichen Körpern etc. berechnet.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
      cout&lt;&lt;&quot;*******************************************************************************&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;*                       Volumen und Flaechenberechnung                        *&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;*******************************************************************************\n\n&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;Flaecheninhalt\n&quot;;
      cout&lt;&lt;&quot;[1]Rechtwinkliges Dreieck\n&quot;;
      cout&lt;&lt;&quot;[2]Allgemeines Viereck\n&quot;;
      cout&lt;&lt;&quot;[3]Trapez\n&quot;;
      cout&lt;&lt;&quot;[4]Parallelogramm\n&quot;;
      cout&lt;&lt;&quot;[5]Drachenviereck\n&quot;;
      cout&lt;&lt;&quot;[6]Rechteck\n&quot;;
      cout&lt;&lt;&quot;[7]Kreis\n&quot;;
      cout&lt;&lt;&quot;[8]Quadrat\n&quot;;
      cout&lt;&lt;&quot;\nVolumen\n&quot;;
      cout&lt;&lt;&quot;[9]Wuerfel\n&quot;;
      cout&lt;&lt;&quot;[10]Quader\n&quot;;
      cout&lt;&lt;&quot;[11]Prisma\n&quot;;
      cout&lt;&lt;&quot;[12]Kreiszylinder\n&quot;;
      cout&lt;&lt;&quot;[13]Pyramide\n&quot;;
      cout&lt;&lt;&quot;[14]Kreiskegel\n&quot;;
      cout&lt;&lt;&quot;[15]Kugel\n&quot;;
      cout&lt;&lt;&quot;\nBitte waehlen Sie!\n&quot;;
      float Wahl;
      cin&gt;&gt;Wahl;
      {
                          if (Wahl==1)
                          cout&lt;&lt;&quot;Bitte geben Sie die erste Kathede ein:\n&quot;;
                          double a;
                          cin&gt;&gt;a;
                          cout&lt;&lt;&quot;Bitte geben Sie die zweite Kathede ein:\n&quot;;
                          double b;
                          cin&gt;&gt;b;
                          double A;
                          A=(a*b)/2;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;A&lt;&lt;&quot;\n&quot;;
      }
      {
                          if (Wahl==4)
                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des ersten Dreiecks ein:\n&quot;;
                          double c;
                          cin&gt;&gt;c;
                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des zweiten Dreiecks ein:\n&quot;;
                          double d;
                          cin&gt;&gt;d;
                          double B;
                          B=c+d;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;B&lt;&lt;&quot;\n&quot;;
      }

      system (&quot;Pause&quot;);
}
</code></pre>
<p>Leider funktioniert es nicht und ich weiß net warum. Wenn ich z.B. 2 eingebe dann kommt trotzdem 1 warum???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/882897</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/882897</guid><dc:creator><![CDATA[Hilfe88]]></dc:creator><pubDate>Thu, 29 Sep 2005 12:05:14 GMT</pubDate></item><item><title><![CDATA[Reply to Kleines Problem on Thu, 29 Sep 2005 12:06:59 GMT]]></title><description><![CDATA[<p>ups da steht net 4 natürlich soll da ne 2 hin allerdings ändert das nichts</p>
]]></description><link>https://www.c-plusplus.net/forum/post/882901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/882901</guid><dc:creator><![CDATA[Hilfe88]]></dc:creator><pubDate>Thu, 29 Sep 2005 12:06:59 GMT</pubDate></item><item><title><![CDATA[Reply to Kleines Problem on Thu, 29 Sep 2005 12:12:33 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Du must die If-bedingung vor den Block schreiben...</p>
<pre><code class="language-cpp">if (Wahl==1)
{
                          cout&lt;&lt;&quot;Bitte geben Sie die erste Kathede ein:\n&quot;;
                          double a;
                          cin&gt;&gt;a;
                          cout&lt;&lt;&quot;Bitte geben Sie die zweite Kathede ein:\n&quot;;
                          double b;
                          cin&gt;&gt;b;
                          double A;
                          A=(a*b)/2;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;A&lt;&lt;&quot;\n&quot;;
      }
</code></pre>
<p>oder gleich switch verwenden.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/882908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/882908</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 29 Sep 2005 12:12:33 GMT</pubDate></item><item><title><![CDATA[Reply to Kleines Problem on Thu, 29 Sep 2005 12:14:57 GMT]]></title><description><![CDATA[<p>deine klammern sind falsch. es wäre auch besser wenn wahl ein int ist.</p>
<pre><code class="language-cpp">cin&gt;&gt;Wahl;
        if (Wahl==1)
        {
                          cout&lt;&lt;&quot;Bitte geben Sie die erste Kathede ein:\n&quot;;
                          double a;
                          cin&gt;&gt;a;
                          cout&lt;&lt;&quot;Bitte geben Sie die zweite Kathede ein:\n&quot;;
                          double b;
                          cin&gt;&gt;b;
                          double A;
                          A=(a*b)/2;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;A&lt;&lt;&quot;\n&quot;;
        }
        else if (Wahl==4)
        {

                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des ersten Dreiecks ein:\n&quot;;
                          double c;
                          cin&gt;&gt;c;
                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des zweiten Dreiecks ein:\n&quot;;
                          double d;
                          cin&gt;&gt;d;
                          double B;
                          B=c+d;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;B&lt;&lt;&quot;\n&quot;;
      }
</code></pre>
<p>ich würde dir auch zu einem sitch case konstrukt raten</p>
<p>[edit]<br />
vier sekunden zu langsam <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/882910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/882910</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Thu, 29 Sep 2005 12:14:57 GMT</pubDate></item><item><title><![CDATA[Reply to Kleines Problem on Thu, 29 Sep 2005 12:14:43 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>mal abgesehen davon, dass das alles etwas unübersichtlich werden wird, ist<br />
der Fehler, dass du die Klammern falsch setzt.</p>
<p>Richtig</p>
<pre><code class="language-cpp">// { &lt;-diese weg
if (Wahl==1)
{
  cout&lt;&lt;&quot;Bitte geben Sie die erste Kathede ein:\n&quot;;
 ....
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/882912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/882912</guid><dc:creator><![CDATA[Jockelx]]></dc:creator><pubDate>Thu, 29 Sep 2005 12:14:43 GMT</pubDate></item><item><title><![CDATA[Reply to Kleines Problem on Thu, 29 Sep 2005 15:25:18 GMT]]></title><description><![CDATA[<p>Nagut ich meine ob das nun unübersichtlich ist oder nicht ist erstmal egal. Aber es funktioniert immer noch net!</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;

int main()
{
      cout&lt;&lt;&quot;*******************************************************************************&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;*                       Volumen und Flaechenberechnung                        *&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;*******************************************************************************\n\n&quot;&lt;&lt;endl;
      cout&lt;&lt;&quot;Flaecheninhalt\n&quot;;
      cout&lt;&lt;&quot;[1]Rechtwinkliges Dreieck\n&quot;;
      cout&lt;&lt;&quot;[2]Allgemeines Viereck\n&quot;;
      cout&lt;&lt;&quot;[3]Trapez\n&quot;;
      cout&lt;&lt;&quot;[4]Parallelogramm\n&quot;;
      cout&lt;&lt;&quot;[5]Drachenviereck\n&quot;;
      cout&lt;&lt;&quot;[6]Rechteck\n&quot;;
      cout&lt;&lt;&quot;[7]Kreis\n&quot;;
      cout&lt;&lt;&quot;[8]Quadrat\n&quot;;
      cout&lt;&lt;&quot;\nVolumen\n&quot;;
      cout&lt;&lt;&quot;[9]Wuerfel\n&quot;;
      cout&lt;&lt;&quot;[10]Quader\n&quot;;
      cout&lt;&lt;&quot;[11]Prisma\n&quot;;
      cout&lt;&lt;&quot;[12]Kreiszylinder\n&quot;;
      cout&lt;&lt;&quot;[13]Pyramide\n&quot;;
      cout&lt;&lt;&quot;[14]Kreiskegel\n&quot;;
      cout&lt;&lt;&quot;[15]Kugel\n&quot;;
      cout&lt;&lt;&quot;\nBitte waehlen Sie!\n&quot;;
      float Wahl;
      cin&gt;&gt;Wahl;
      if (Wahl=1)
      {
                          cout&lt;&lt;&quot;Bitte geben Sie die erste Kathede ein:\n&quot;;
                          double a;
                          cin&gt;&gt;a;
                          cout&lt;&lt;&quot;Bitte geben Sie die zweite Kathede ein:\n&quot;;
                          double b;
                          cin&gt;&gt;b;
                          double A;
                          A=(a*b)/2;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;A&lt;&lt;&quot;\n&quot;;
      }
      if (Wahl=2)
      {
                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des ersten Dreiecks ein:\n&quot;;
                          double c;
                          cin&gt;&gt;c;
                          cout&lt;&lt;&quot;Bitte geben Sie den Flaecheninhalt des zweiten Dreiecks ein:\n&quot;;
                          double d;
                          cin&gt;&gt;d;
                          double B;
                          B=c+d;
                          cout&lt;&lt;&quot;Der Flaecheninhalt betraegt: &quot;&lt;&lt;B&lt;&lt;&quot;\n&quot;;
      }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/883080</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/883080</guid><dc:creator><![CDATA[Hilfe88]]></dc:creator><pubDate>Thu, 29 Sep 2005 15:25:18 GMT</pubDate></item><item><title><![CDATA[Reply to Kleines Problem on Thu, 29 Sep 2005 15:27:52 GMT]]></title><description><![CDATA[<p>OK habs selber gesehen habe ein = vergessen! Danke für eure Hilfe!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/883084</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/883084</guid><dc:creator><![CDATA[Hilfe88]]></dc:creator><pubDate>Thu, 29 Sep 2005 15:27:52 GMT</pubDate></item></channel></rss>