<?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[Programm wartet nicht auf Eingabe von der Tastatur]]></title><description><![CDATA[<p>Ich habe einen kleinen Rechne für Prozentrechnungen gemacht.<br />
Erstmal der code:<br />
das ist nur ein ausschnitt</p>
<pre><code>cout &lt;&lt; &quot;Sie haben Prozentrechnung gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Was wollen sie berechnen?&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;S: Prozentsatz&quot; &lt;&lt; endl &lt;&lt; &quot;W: Prozentwert&quot; &lt;&lt; endl &lt;&lt; &quot;G: Grundwert&quot; &lt;&lt; endl;
				cin &gt;&gt; a;
				if (a == 'S')
				{
					cout &lt;&lt; &quot;Sie haben Prozentsatz gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie W und G ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;W:&quot; &lt;&lt; endl;
					cin &gt;&gt; PW;
					cout &lt;&lt; &quot;G:&quot; &lt;&lt; endl;
					cin &gt;&gt; GW;
					E = PW / GW * 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (a == 'W')
				{
					cout &lt;&lt; &quot;Sie haben Prozentwert gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie S und G ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;S:&quot; &lt;&lt; endl;
					cin &gt;&gt; PS;
					cout &lt;&lt; &quot;G:&quot; &lt;&lt; endl;
					cin &gt;&gt; GW;
					E = GW * PS / 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (a == 'G')
				{
					cout &lt;&lt; &quot;Sie haben Grundwert gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie S und W ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;S:&quot; &lt;&lt; endl;
					cin &gt;&gt; PS;
					cout &lt;&lt; &quot;W:&quot; &lt;&lt; endl;
					cin &gt;&gt; PW;
					E = PW / PS * 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
			}

			if (A == 'T')
			{
				cout &lt;&lt; &quot;Geben sie einen Term mit max. 2 Zahlen und +, -, *, / ein.&quot; &lt;&lt; endl;
				cin &gt;&gt; x  &gt;&gt; R  &gt;&gt; y;
				if (R == '+')
				{
					E = x + y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '-')
				{
					E = x - y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '*')
				{
					E = x * y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '/')
				{
					E = x / y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
</code></pre>
<p>Das Problem ist nun, wenn ich entwerer grundsatz, Prozentwert oder Prozentsatz auswähle und dann die fehlenden werte eingeben soll (nehme jetzt als Beispiel Grundwert), dann wird ein falsches Ergebnis herausgegeben bevor ich überhaupt die zweite vorgabe angegeben hab.<br />
heißt: Es wird nach dem Prozentsatz gefragt, ich gebe eine zahl ein, drück enter, und es erscheint die nachfrage für den Prozentwert, jedoch ohne dass ich etwas eingeben kann ist direkt dadrunter: Das Ergebnis ist: und dann 0 oder irgendetwas anderes.<br />
beizumerken ist vll. noch dass PS, PW und GW den dateityp char haben und für Prozentsatz, Prozentwert und Grundwert stehen<br />
schwer zu verstehen, zur not lade ich die konsolendatei hoch<br />
hoffe um hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/304876/programm-wartet-nicht-auf-eingabe-von-der-tastatur</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 05:18:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/304876.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Jun 2012 20:01:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 20:21:04 GMT]]></title><description><![CDATA[<p>Ich habe einen kleinen Rechne für Prozentrechnungen gemacht.<br />
Erstmal der code:<br />
das ist nur ein ausschnitt</p>
<pre><code>cout &lt;&lt; &quot;Sie haben Prozentrechnung gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Was wollen sie berechnen?&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;S: Prozentsatz&quot; &lt;&lt; endl &lt;&lt; &quot;W: Prozentwert&quot; &lt;&lt; endl &lt;&lt; &quot;G: Grundwert&quot; &lt;&lt; endl;
				cin &gt;&gt; a;
				if (a == 'S')
				{
					cout &lt;&lt; &quot;Sie haben Prozentsatz gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie W und G ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;W:&quot; &lt;&lt; endl;
					cin &gt;&gt; PW;
					cout &lt;&lt; &quot;G:&quot; &lt;&lt; endl;
					cin &gt;&gt; GW;
					E = PW / GW * 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (a == 'W')
				{
					cout &lt;&lt; &quot;Sie haben Prozentwert gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie S und G ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;S:&quot; &lt;&lt; endl;
					cin &gt;&gt; PS;
					cout &lt;&lt; &quot;G:&quot; &lt;&lt; endl;
					cin &gt;&gt; GW;
					E = GW * PS / 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (a == 'G')
				{
					cout &lt;&lt; &quot;Sie haben Grundwert gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie S und W ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;S:&quot; &lt;&lt; endl;
					cin &gt;&gt; PS;
					cout &lt;&lt; &quot;W:&quot; &lt;&lt; endl;
					cin &gt;&gt; PW;
					E = PW / PS * 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
			}

			if (A == 'T')
			{
				cout &lt;&lt; &quot;Geben sie einen Term mit max. 2 Zahlen und +, -, *, / ein.&quot; &lt;&lt; endl;
				cin &gt;&gt; x  &gt;&gt; R  &gt;&gt; y;
				if (R == '+')
				{
					E = x + y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '-')
				{
					E = x - y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '*')
				{
					E = x * y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '/')
				{
					E = x / y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
</code></pre>
<p>Das Problem ist nun, wenn ich entwerer grundsatz, Prozentwert oder Prozentsatz auswähle und dann die fehlenden werte eingeben soll (nehme jetzt als Beispiel Grundwert), dann wird ein falsches Ergebnis herausgegeben bevor ich überhaupt die zweite vorgabe angegeben hab.<br />
heißt: Es wird nach dem Prozentsatz gefragt, ich gebe eine zahl ein, drück enter, und es erscheint die nachfrage für den Prozentwert, jedoch ohne dass ich etwas eingeben kann ist direkt dadrunter: Das Ergebnis ist: und dann 0 oder irgendetwas anderes.<br />
beizumerken ist vll. noch dass PS, PW und GW den dateityp char haben und für Prozentsatz, Prozentwert und Grundwert stehen<br />
schwer zu verstehen, zur not lade ich die konsolendatei hoch<br />
hoffe um hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223725</guid><dc:creator><![CDATA[Golol]]></dc:creator><pubDate>Fri, 15 Jun 2012 20:21:04 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 20:39:15 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>mach doch mal ne Kopie der Console.</p>
<p>Gruss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223732</guid><dc:creator><![CDATA[tommy_tom_tom]]></dc:creator><pubDate>Fri, 15 Jun 2012 20:39:15 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 20:59:06 GMT]]></title><description><![CDATA[<p><a href="http://www.file-upload.net/download-4448720/C--_Projekt_1.exe.html" rel="nofollow">http://www.file-upload.net/download-4448720/C--_Projekt_1.exe.html</a><br />
nen downloadlink.<br />
da der teil mit prozentrechnung zu einem kompletten rechner gehört ist davor noch anderes zeugs.<br />
nimm einfach algebra und dann prozentrechnung<br />
dann kannst dus selber testen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223739</guid><dc:creator><![CDATA[Golol]]></dc:creator><pubDate>Fri, 15 Jun 2012 20:59:06 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 21:15:21 GMT]]></title><description><![CDATA[<p>ich sitz hier an linux <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":-("
      alt="😞"
    /> ich kann und will keine win.exe ausführenn <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>Poste doch mal den Rest der Funktion.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223748</guid><dc:creator><![CDATA[tommy_tom_tom]]></dc:creator><pubDate>Fri, 15 Jun 2012 21:15:21 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 21:19:59 GMT]]></title><description><![CDATA[<p>Schau dir mal an was cin.fail() ist. Wenn der Benutzer hier irgendwo etwas anderes als exakt den gesuchten Typ eingibt, dann wird das Fail Bit gesetzt und sämtliche Input Operationen rauschen von dort weg durch, weil es nirgendwo gecleared wird...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223749</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 15 Jun 2012 21:19:59 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 21:28:36 GMT]]></title><description><![CDATA[<p>@ dot<br />
kapier ich net <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=":confused:"
      alt="😕"
    /><br />
@ tommy<br />
meinst du nen screen oder den restlichen code?</p>
<pre><code>#include&lt;iostream&gt;
using namespace std;

int main()
{
	float P;			//Pi
	float r;			//Radius
	float x;			//Erste Variable
	float y;			//Zweite Variable
	float E;			//Ergebnis
	float h;			//Höhe
	float l;			//Länge
	float l_2;			//Länge 2
	float l_3;			//Länge 3
	float l_4;			//Länge 4
	float UE_1;			//Unterergebnis 1
	char a;				//Auswahl (Bei Fläche oder Umfang)
	char W;				//Wahl (Bei Algebra oder Geometrie)
	char R;				//Rechenzeichen
	char b;				//Beenden
	char A;				//Auswahl (bei geometrie)
	char PS;			//Prozentsatz
	char PW;			//Prozentwert
	char GW;			//Grundwert
	P = 3.141592;		//Definierung Pi

	cout &lt;&lt; &quot;Algebra (a) oder Geometrie (g)?&quot; &lt;&lt; endl;
	cin &gt;&gt; W;
	if (W == 'g')
	{
		cout &lt;&lt; &quot;Was wollen sie berechnen?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;K: Kreis&quot; &lt;&lt; endl &lt;&lt; &quot;R: Rechteck&quot; &lt;&lt; endl &lt;&lt; &quot;T: Trapez&quot; &lt;&lt; endl &lt;&lt; &quot;D: Dreieck&quot; &lt;&lt; endl &lt;&lt; &quot;P: Parallelogramm&quot; &lt;&lt; endl;
		cin &gt;&gt; A;

		if (A == 'K')
		{
			cout &lt;&lt; &quot;Sie haben Kreis gewählt.&quot; &lt;&lt; endl &lt;&lt; &quot;Was möchten sie berechnen?&quot; &lt;&lt; endl &lt;&lt; &quot;U: Umfang&quot; &lt;&lt; endl &lt;&lt; &quot;F: Fläche&quot; &lt;&lt; endl;
			cin &gt;&gt; a;

			if (a == 'U')
			{
				cout &lt;&lt; &quot;Sie haben Umfang gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie den Radius ein:&quot; &lt;&lt; endl;
				cin &gt;&gt; r;
				E = 2 * r * P;
				cout &lt;&lt; &quot;Der Umfang beträgt:&quot; &lt;&lt; E &lt;&lt; endl;
			}
			if (a == 'F')
			{
				cout &lt;&lt; &quot;Sie haben Fläche gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie den Radius ein:&quot; &lt;&lt; endl;
				cin &gt;&gt; r;
				E = r * r * P;
				cout &lt;&lt; &quot;Die Fläche beträgt:&quot; &lt;&lt; E &lt;&lt; endl;
			}
		}
		if (A == 'R')
		{
			cout &lt;&lt; &quot;Sie haben Rechteck gewählt.&quot; &lt;&lt; endl &lt;&lt; &quot;Was möchten sie berechnen?&quot; &lt;&lt; endl &lt;&lt; &quot;U: Umfang&quot; &lt;&lt; endl &lt;&lt; &quot;F: Fläche&quot; &lt;&lt; endl;
			cin &gt;&gt; a;

			if (a == 'U')
			{
				cout &lt;&lt; &quot;Sie haben Umfang gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie Höhe und Länge ein&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Höhe:&quot; &lt;&lt; endl;
				cin &gt;&gt; h;
				cout &lt;&lt; &quot;Länge:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				E = 2 * h + 2 * l;
				cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
			if (a == 'F')
			{
				cout &lt;&lt; &quot;Sie haben Fläche gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie Höhe und Länge ein&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Höhe:&quot; &lt;&lt; endl;
				cin &gt;&gt; h;
				cout &lt;&lt; &quot;Länge:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				E = h * l;
				cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
		}
		if (A == 'T')
		{
			cout &lt;&lt; &quot;Sie haben Trapez gewählt.&quot; &lt;&lt; endl &lt;&lt; &quot;Was möchten sie berechnen?&quot; &lt;&lt; endl &lt;&lt; &quot;U: Umfang&quot; &lt;&lt; endl &lt;&lt; &quot;F: Fläche&quot; &lt;&lt; endl;
			cin &gt;&gt; a;

			if (a == 'U')
			{
				cout &lt;&lt; &quot;Sie haben Umfang gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie die Längen der Vier Seiten an&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Seite 1:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				cout &lt;&lt; &quot;Seite 2:&quot; &lt;&lt; endl;
				cin &gt;&gt; l_2;
				cout &lt;&lt; &quot;Seite 3:&quot; &lt;&lt; endl;
				cin &gt;&gt; l_3;
				cout &lt;&lt; &quot;Seite 4:&quot; &lt;&lt; endl;
				cin &gt;&gt; l_4;
				E = l + l_2 + l_3 + l_4;
				cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
			if (a == 'F')
			{
				cout &lt;&lt; &quot;Sie haben Fläche gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie die Längen der Parallelen Seiten und die Höhe an.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Seite 1:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				cout &lt;&lt; &quot;Seite 2:&quot; &lt;&lt; endl;
				cin &gt;&gt; l_2;
				cout &lt;&lt; &quot;Höhe&quot; &lt;&lt; endl;
				cin &gt;&gt; h;
				UE_1 = l + l_2;
				E = UE_1 / 2 * h;
				cout &lt;&lt; &quot;DasErgebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
		}
		if (A == 'D')
		{
			cout &lt;&lt; &quot;Sie haben Dreieck gewählt.&quot; &lt;&lt; endl &lt;&lt; &quot;Was möchten sie berechnen?&quot; &lt;&lt; endl &lt;&lt; &quot;U: Umfang&quot; &lt;&lt; endl &lt;&lt; &quot;F: Fläche&quot; &lt;&lt; endl;
			cin &gt;&gt; a;

			if (a == 'U')
			{
				cout &lt;&lt; &quot;Sie haben Umfang gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie die Längen der Seiten an.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Seite 1:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				cout &lt;&lt; &quot;Seite 2:&quot; &lt;&lt; endl;
				cin &gt;&gt; l_2;
				cout &lt;&lt; &quot;Seite 3:&quot; &lt;&lt; endl;
				cin &gt;&gt; l_3;
				E = l + l_2 + l_3;
				cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
			if (a == 'F')
			{
				cout &lt;&lt; &quot;Sie haben Fläche gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie die Länge und die Höhe an.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Höhe:&quot; &lt;&lt; endl;
				cin &gt;&gt; h;
				cout &lt;&lt; &quot;Länge:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				E = l * h / 2;
				cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
		}
		if (A == 'P')
		{
			cout &lt;&lt; &quot;Sie haben Parallelogramm gewählt.&quot; &lt;&lt; endl &lt;&lt; &quot;Was möchten sie berechnen?&quot; &lt;&lt; endl &lt;&lt; &quot;U: Umfang&quot; &lt;&lt; endl &lt;&lt; &quot;F: Fläche&quot; &lt;&lt; endl;
			cin &gt;&gt; a;
			if (a == 'U')
			{
				cout &lt;&lt; &quot;Sie haben Umfang gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie die Längen von zwei nicht parallelen Seiten an.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Seite 1:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				cout &lt;&lt; &quot;Seite 2:&quot; &lt;&lt; endl;
				cin &gt;&gt; l_2;
				E = 2 * l + 2 * l_2;
				cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
			if (a == 'F')
			{
				cout &lt;&lt; &quot;Sie haben Fläche gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Geben sie die Länge und die Höhe an.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Höhe:&quot; &lt;&lt; endl;
				cin &gt;&gt; h;
				cout &lt;&lt; &quot;Länge:&quot; &lt;&lt; endl;
				cin &gt;&gt; l;
				E = l * h;
				cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
			}
		}
	}

	if (W == 'a')
	{
		cout &lt;&lt; &quot;Was wollen sie berechnen?&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;T: normale Terme&quot; &lt;&lt; endl;
		cout &lt;&lt; &quot;P: Prozentrechnung&quot; &lt;&lt; endl;
		cin &gt;&gt; A;

			if (A == 'P')
			{
				cout &lt;&lt; &quot;Sie haben Prozentrechnung gewählt.&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;Was wollen sie berechnen?&quot; &lt;&lt; endl;
				cout &lt;&lt; &quot;S: Prozentsatz&quot; &lt;&lt; endl &lt;&lt; &quot;W: Prozentwert&quot; &lt;&lt; endl &lt;&lt; &quot;G: Grundwert&quot; &lt;&lt; endl;
				cin &gt;&gt; a;
				if (a == 'S')
				{
					cout &lt;&lt; &quot;Sie haben Prozentsatz gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie W und G ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;W:&quot; &lt;&lt; endl;
					cin &gt;&gt; PW;
					cout &lt;&lt; &quot;G:&quot; &lt;&lt; endl;
					cin &gt;&gt; GW;
					E = PW / GW * 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (a == 'W')
				{
					cout &lt;&lt; &quot;Sie haben Prozentwert gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie S und G ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;S:&quot; &lt;&lt; endl;
					cin &gt;&gt; PS;
					cout &lt;&lt; &quot;G:&quot; &lt;&lt; endl;
					cin &gt;&gt; GW;
					E = GW * PS / 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (a == 'G')
				{
					cout &lt;&lt; &quot;Sie haben Grundwert gewählt&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;Geben sie S und W ein.&quot; &lt;&lt; endl;
					cout &lt;&lt; &quot;S:&quot; &lt;&lt; endl;
					cin &gt;&gt; PS;
					cout &lt;&lt; &quot;W:&quot; &lt;&lt; endl;
					cin &gt;&gt; PW;
					E = PW / PS * 100;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
			}

			if (A == 'T')
			{
				cout &lt;&lt; &quot;Geben sie einen Term mit max. 2 Zahlen und +, -, *, / ein.&quot; &lt;&lt; endl;
				cin &gt;&gt; x  &gt;&gt; R  &gt;&gt; y;
				if (R == '+')
				{
					E = x + y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '-')
				{
					E = x - y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '*')
				{
					E = x * y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
				if (R == '/')
				{
					E = x / y;
					cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
				}
			}
	}
	cout &lt;&lt; &quot;Geben sie ein beliebiges Zeichen ein und Drücken sie Enter zum beenden&quot; &lt;&lt; endl &lt;&lt; &quot;des Programms&quot; &lt;&lt; endl;
	cin &gt;&gt; b;
	return 0;

}
</code></pre>
<p>habe auch etwas gemerkt. wenn ich als ersten wert zahlen über 10 nehme kommt der fehler. bei einstelligen sachen klappt alles.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223753</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223753</guid><dc:creator><![CDATA[Golol]]></dc:creator><pubDate>Fri, 15 Jun 2012 21:28:36 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 21:33:08 GMT]]></title><description><![CDATA[<p>Golol schrieb:</p>
<blockquote>
<p>@ dot<br />
kapier ich net <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=":confused:"
      alt="😕"
    /></p>
</blockquote>
<p>Was genau kapierst du nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223755</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 15 Jun 2012 21:33:08 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 21:41:41 GMT]]></title><description><![CDATA[<p>Ich kapier net:<br />
-cin.fail()<br />
-exakt den gesuchten Typ<br />
-Fail Bit gesetzt<br />
-Input Operationen rauschen<br />
-nirgendwo gecleared wird<br />
im endeffekt hab ich kein plan.<br />
Und ich hab das programm gelöst. ich hatte ja gemerkt dass es mit beträgen die höher als 10 sind nicht ging und dachte mirn dass das vielleicht daran liuegt das der dateityp nicht mehr schafft. wollte dann einfach double neben und hab gemerkt dass GW, PW und PS CHAR statt float hatten. ich hatte sooft char genommen dass ich automatisch char genommen hab.<br />
jetzt klappt alles. danke für die hilfe und sorry dass mir nach dem posten der frage die lösung einfällt &gt;&lt;. ich denk eine stunde drüber nach, poste die frage und dann merk ichs :D.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223759</guid><dc:creator><![CDATA[Golol]]></dc:creator><pubDate>Fri, 15 Jun 2012 21:41:41 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 21:43:16 GMT]]></title><description><![CDATA[<p><a href="http://www.google.at/search?q=cin+fail" rel="nofollow">http://www.google.at/search?q=cin+fail</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223761</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 15 Jun 2012 21:43:16 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 22:36:01 GMT]]></title><description><![CDATA[<p>probier mal mit extra Ausgabe des Eingabewertes:</p>
<pre><code class="language-cpp">cout &lt;&lt; &quot;Sie haben Prozentsatz gewählt&quot; &lt;&lt; endl;
     cout &lt;&lt; &quot;Geben sie W und G ein.&quot; &lt;&lt; endl;
     cout &lt;&lt; &quot;W:&quot; &lt;&lt; endl;
     cin &gt;&gt; PW;

     cout &lt;&lt; &quot;W eingabe:&quot; &lt;&lt; int(PW) &lt;&lt; endl;

     cout &lt;&lt; &quot;G:&quot; &lt;&lt; endl;
     cin &gt;&gt; GW;
     E = PW / GW * 100;
     cout &lt;&lt; &quot;Das Ergebnis ist:&quot; &lt;&lt; E &lt;&lt; endl;
</code></pre>
<p>Ein <strong>teil</strong> deines Problem liegt also an</p>
<pre><code class="language-cpp">char PW;            //Prozentwert
</code></pre>
<p>ein int wäre angebrachter... zur Erklärung möchte ich besser einen Profi bitten.</p>
<pre><code class="language-cpp">int PW;            //Prozentwert
</code></pre>
<p>nochmal probieren mit der extra Ausgabe.</p>
<p>Des weiteren würde ich dir switch für solche codeblöcke und die Aufsplittung in einzelne Funktionen empfehlen.</p>
<p>Sowie evtl solche Eingaben zum debugen auszugeben. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>Des weiteren lässt dein Code nur Grossbuchstaben zu, muss das sein?</p>
<p>Viel Erfolg beim tüfteln!<br />
Tommy</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223765</guid><dc:creator><![CDATA[tommy_tom_tom]]></dc:creator><pubDate>Fri, 15 Jun 2012 22:36:01 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Fri, 15 Jun 2012 22:35:02 GMT]]></title><description><![CDATA[<p>ähhhhhhhhhh, egal... ich sollte nochmals lesen vorm senden...</p>
<p>aber</p>
<blockquote>
<p>Und ich hab das programm gelöst. ich hatte ja gemerkt dass es mit beträgen die höher als 10 sind nicht ging und dachte mirn dass das vielleicht daran liuegt das der dateityp nicht mehr schafft.</p>
</blockquote>
<p>da würd ich nicht die Hand ins Feuer für legen -&gt; char &quot;schafft&quot; mehr als 10.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223766</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223766</guid><dc:creator><![CDATA[tommy_tom_tom]]></dc:creator><pubDate>Fri, 15 Jun 2012 22:35:02 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Sat, 16 Jun 2012 14:46:14 GMT]]></title><description><![CDATA[<p>du meinst ich sollte machen dass man wenn da steht W: Prozentwert man W aber auch w eingeben kann? ja wär schlau. ob ich das noch nachträgluch mache weiß ich net weil das war ja nur ne übung aber es wär schon schlauer.<br />
das müste ich dann machen mit if (a == W || a == w) oder?<br />
und ich habe if else benutzt weil das noch die kenntnisse waren die ich hatte. bei meinem zweiten buch fängt jetzt erst if else an und wie das ging wusste ich noch von vorher</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2223910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2223910</guid><dc:creator><![CDATA[Golol]]></dc:creator><pubDate>Sat, 16 Jun 2012 14:46:14 GMT</pubDate></item><item><title><![CDATA[Reply to Programm wartet nicht auf Eingabe von der Tastatur on Sat, 16 Jun 2012 22:46:30 GMT]]></title><description><![CDATA[<p>Golol schrieb:</p>
<blockquote>
<p>das müste ich dann machen mit if (a == W || a == w) oder?</p>
</blockquote>
<p>Ist ne gute Idee, oder? <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>
<p>Schau dir mal die switch an für solche grossen Blöcke wie in deinen ersten Posts.<br />
<a href="http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/c++_switch_de" rel="nofollow">http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/c++_switch_de</a></p>
<p>Tommy</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2224045</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2224045</guid><dc:creator><![CDATA[tommy_tom_tom]]></dc:creator><pubDate>Sat, 16 Jun 2012 22:46:30 GMT</pubDate></item></channel></rss>