<?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[If schleife?]]></title><description><![CDATA[<p>Hallo Liebe Community,<br />
ich habe gestern mal angefangen mir c++ anzuschauen...<br />
Siehe:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

int main() {
	string name;
	int alter;
	string antwort;
	string thema;
	string themaantwort;
	string themainfo;
	string infoantwort;
	string antwortgenuggeredet;
	string ende;
	string affeantwort;
	string antwortstatus;

	cout &lt;&lt; &quot;Guten Tag, mein Name ist Professor ... David Stutz. Wie lautet dein Name?&quot; &lt;&lt; endl;
	cin &gt;&gt; name;
	cout &lt;&lt; &quot;Achja, dein Name lautet &quot; &lt;&lt; name &lt;&lt; &quot;, danke.&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;Und wie alt bist du?&quot; &lt;&lt; endl;
	cin &gt;&gt; alter;
	cout &lt;&lt; &quot;Du bist also &quot; &lt;&lt; alter &lt;&lt; &quot; Jahre alt.&quot; &lt;&lt; endl;
	cin &gt;&gt; antwort;
	cout &lt;&lt; &quot;Okay, über was möchtest du denn grade sprechen?&quot; &lt;&lt; endl;
	cin &gt;&gt; thema;
	cout &lt;&lt;&quot;Oh, &quot; &lt;&lt; thema &lt;&lt; &quot; ist ein gutes Thema, findest du nicht?&quot; endl;
	cin &gt;&gt; themaantwort;
	cout &lt;&lt; &quot;Okay, erzähl mir etwas über das Thema &quot; &lt;&lt; thema &lt;&lt; endl;
	cin &gt;&gt; themainfo;
	cout &lt;&lt; &quot;Sehr interessant, woher weißt du das alles?&quot; endl;
	cin &gt;&gt; infoantwort;
	cout &lt;&lt; &quot;Okay, lass uns über etwas anderes reden. Über das Thema &quot; &lt;&lt; thema &lt;&lt; &quot; haben wir genug geredet.&quot; endl;
	cin &gt;&gt; antwortgenuggeredet;
	cout &lt;&lt; &quot;Lass und über den Affen reden.&quot; endl;
	cin &gt;&gt; affeantwort;
	cout &lt;&lt; &quot;Ich werde dir nun ein paar Fragen stellen....ist das ok für dich?&quot; endl;
	cin &gt;&gt; frageantwort;
	cout &lt;&lt; &quot;Okay von wem Stammt der Affe ab?&quot; endl;
	cin &gt;&gt; affeantwort1;
	cout &lt;&lt; &quot;Genau, der Affe stammt vom Menschen ab...&quot; endl;
	cout &lt;&lt; &quot;...&quot; &lt;&lt; Name &lt;&lt; &quot; bist du noch da?&quot; endl;
	cin &gt;&gt; antwortstatus1;
	cout &lt;&lt; &quot;Oooops! &quot; &lt;&lt; name &lt;&lt; &quot; wir verschieben das Gespräch! Ich muss schnell weg, da ich meinen Bus sonst verpasse!&quot; endl;
	cin &gt;&gt; ende;

	cin.clear();
    cin.ignore(cin.rdbuf()-&gt;in_avail());
    cin.get();

	return 0;
}
</code></pre>
<p>Meine Frage:</p>
<p>Ist es möglich, dass er 2 verschiedene Sachen ausgibt, wenn &quot;antwortstatus1&quot; = &quot;ja&quot; oder &quot;nein&quot; ist.</p>
<p>Beispiel:</p>
<p>cout &lt;&lt; &quot;Bist du noch da&quot; endl;<br />
cin &gt;&gt; antwort &quot;entweder ja oder nein&quot;<br />
cout &lt;&lt; ||Bei ja|| --&gt; &quot;Okay, dann lass uns weiter machen!&quot; || bei nein||--&gt; &quot;sag bescheid, wenn du wieder da bist&quot; endl;</p>
<p>____________________________</p>
<p>Vom logischen Ablauf würde ich es nun so machen:</p>
<p>IF(antwortstatus1=ja) THEN(&quot;antwort&quot;=&quot;lass und weiter machen&quot;)<br />
IF(antwortstatus1=nein) THEN(&quot;antwort&quot;=&quot;melde dich, wenn du wieder da bist&quot;)</p>
<p>Bitte weisst mich auf Fehler oder Verbesserungsvorschläge hin..danke!</p>
<p>Liebe Grüße<br />
David <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/topic/288866/if-schleife</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 16:16:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/288866.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 Jun 2011 09:59:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 09:59:11 GMT]]></title><description><![CDATA[<p>Hallo Liebe Community,<br />
ich habe gestern mal angefangen mir c++ anzuschauen...<br />
Siehe:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

int main() {
	string name;
	int alter;
	string antwort;
	string thema;
	string themaantwort;
	string themainfo;
	string infoantwort;
	string antwortgenuggeredet;
	string ende;
	string affeantwort;
	string antwortstatus;

	cout &lt;&lt; &quot;Guten Tag, mein Name ist Professor ... David Stutz. Wie lautet dein Name?&quot; &lt;&lt; endl;
	cin &gt;&gt; name;
	cout &lt;&lt; &quot;Achja, dein Name lautet &quot; &lt;&lt; name &lt;&lt; &quot;, danke.&quot; &lt;&lt; endl;
	cout &lt;&lt; &quot;Und wie alt bist du?&quot; &lt;&lt; endl;
	cin &gt;&gt; alter;
	cout &lt;&lt; &quot;Du bist also &quot; &lt;&lt; alter &lt;&lt; &quot; Jahre alt.&quot; &lt;&lt; endl;
	cin &gt;&gt; antwort;
	cout &lt;&lt; &quot;Okay, über was möchtest du denn grade sprechen?&quot; &lt;&lt; endl;
	cin &gt;&gt; thema;
	cout &lt;&lt;&quot;Oh, &quot; &lt;&lt; thema &lt;&lt; &quot; ist ein gutes Thema, findest du nicht?&quot; endl;
	cin &gt;&gt; themaantwort;
	cout &lt;&lt; &quot;Okay, erzähl mir etwas über das Thema &quot; &lt;&lt; thema &lt;&lt; endl;
	cin &gt;&gt; themainfo;
	cout &lt;&lt; &quot;Sehr interessant, woher weißt du das alles?&quot; endl;
	cin &gt;&gt; infoantwort;
	cout &lt;&lt; &quot;Okay, lass uns über etwas anderes reden. Über das Thema &quot; &lt;&lt; thema &lt;&lt; &quot; haben wir genug geredet.&quot; endl;
	cin &gt;&gt; antwortgenuggeredet;
	cout &lt;&lt; &quot;Lass und über den Affen reden.&quot; endl;
	cin &gt;&gt; affeantwort;
	cout &lt;&lt; &quot;Ich werde dir nun ein paar Fragen stellen....ist das ok für dich?&quot; endl;
	cin &gt;&gt; frageantwort;
	cout &lt;&lt; &quot;Okay von wem Stammt der Affe ab?&quot; endl;
	cin &gt;&gt; affeantwort1;
	cout &lt;&lt; &quot;Genau, der Affe stammt vom Menschen ab...&quot; endl;
	cout &lt;&lt; &quot;...&quot; &lt;&lt; Name &lt;&lt; &quot; bist du noch da?&quot; endl;
	cin &gt;&gt; antwortstatus1;
	cout &lt;&lt; &quot;Oooops! &quot; &lt;&lt; name &lt;&lt; &quot; wir verschieben das Gespräch! Ich muss schnell weg, da ich meinen Bus sonst verpasse!&quot; endl;
	cin &gt;&gt; ende;

	cin.clear();
    cin.ignore(cin.rdbuf()-&gt;in_avail());
    cin.get();

	return 0;
}
</code></pre>
<p>Meine Frage:</p>
<p>Ist es möglich, dass er 2 verschiedene Sachen ausgibt, wenn &quot;antwortstatus1&quot; = &quot;ja&quot; oder &quot;nein&quot; ist.</p>
<p>Beispiel:</p>
<p>cout &lt;&lt; &quot;Bist du noch da&quot; endl;<br />
cin &gt;&gt; antwort &quot;entweder ja oder nein&quot;<br />
cout &lt;&lt; ||Bei ja|| --&gt; &quot;Okay, dann lass uns weiter machen!&quot; || bei nein||--&gt; &quot;sag bescheid, wenn du wieder da bist&quot; endl;</p>
<p>____________________________</p>
<p>Vom logischen Ablauf würde ich es nun so machen:</p>
<p>IF(antwortstatus1=ja) THEN(&quot;antwort&quot;=&quot;lass und weiter machen&quot;)<br />
IF(antwortstatus1=nein) THEN(&quot;antwort&quot;=&quot;melde dich, wenn du wieder da bist&quot;)</p>
<p>Bitte weisst mich auf Fehler oder Verbesserungsvorschläge hin..danke!</p>
<p>Liebe Grüße<br />
David <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/2083081</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083081</guid><dc:creator><![CDATA[limos1]]></dc:creator><pubDate>Fri, 24 Jun 2011 09:59:11 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 10:05:50 GMT]]></title><description><![CDATA[<p><a href="http://www.if-schleife.de" rel="nofollow">www.if-schleife.de</a></p>
<p>Lies mal ein paar Seiten weiter in deinem Lehrbuch:<br />
if (antwortstatus1==&quot;ja&quot;) cout &lt;&lt; &quot;lass und weiter machen&quot;;<br />
if (antwortstatus1==&quot;nein&quot;) cout &lt;&lt; &quot;melde dich, wenn du wieder da bist&quot;;</p>
<p>Über if gibt es aber noch weitaus mehr zu sagen, als ich hier im Rahmen eines Forenbeitrags darstellen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083086</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 24 Jun 2011 10:05:50 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 10:26:31 GMT]]></title><description><![CDATA[<p>Vielen Dank! hat geklappt!</p>
<p>Noch ein paar Fragen:</p>
<p>Hättest du vllt einen Geheimtipp in Sachen Compiler?<br />
Gibt es seiten wie Selfhtml auch für c++? [DONE]</p>
<p>Liebe Grüße<br />
David <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/2083089</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083089</guid><dc:creator><![CDATA[limos1]]></dc:creator><pubDate>Fri, 24 Jun 2011 10:26:31 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 10:18:50 GMT]]></title><description><![CDATA[<p>Ich empfehle dir dieses Tutorial.<br />
<a href="http://www.highscore.de/cpp/einfuehrung/" rel="nofollow">http://www.highscore.de/cpp/einfuehrung/</a><br />
Es vermittelt die ersten Grundlagen der Programmierung inkl. Übungen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083092</guid><dc:creator><![CDATA[Joscha__]]></dc:creator><pubDate>Fri, 24 Jun 2011 10:18:50 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 10:32:34 GMT]]></title><description><![CDATA[<p>Wie siehts mit dem Compiler aus?</p>
<p>Liebe Grüße <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/2083104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083104</guid><dc:creator><![CDATA[limos1]]></dc:creator><pubDate>Fri, 24 Jun 2011 10:32:34 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 10:36:19 GMT]]></title><description><![CDATA[<p>limos1 schrieb:</p>
<blockquote>
<p>Wie siehts mit dem Compiler aus?</p>
</blockquote>
<p>VC++<br />
GCC G++</p>
<p>Du suchst allerdings ziemlich sicher eine IDE dazu:<br />
Visual C++ 2010 Express Edition<br />
Code::Blocks</p>
<p>Ich persönlich würde den Ersten nehmen und dir auch den empfehlen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083105</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Fri, 24 Jun 2011 10:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 11:07:08 GMT]]></title><description><![CDATA[<p>Joscha__ schrieb:</p>
<blockquote>
<p>Ich empfehle dir dieses Tutorial.<br />
<a href="http://www.highscore.de/cpp/einfuehrung/" rel="nofollow">http://www.highscore.de/cpp/einfuehrung/</a><br />
Es vermittelt die ersten Grundlagen der Programmierung inkl. Übungen.</p>
</blockquote>
<p>Ich persönlich würde das nicht empfehlen. Tutorials kenne ich kein einziges gutes und auch dieses ist eher ein (gutes) C-Tutorial mit cout statt printf. Buchtipps gibt's hier im Forum massenhaft Threads für.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083126</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083126</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 24 Jun 2011 11:07:08 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 11:12:55 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Ich persönlich würde das nicht empfehlen. Tutorials kenne ich kein einziges gutes und auch dieses ist eher ein (gutes) C-Tutorial mit cout statt printf. Buchtipps gibt's hier im Forum massenhaft Threads für.</p>
</blockquote>
<p>Es vermittelt aber ein Grundkenntniss an Funktionen, Schleifen und anderen Dinge.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083128</guid><dc:creator><![CDATA[Joscha__]]></dc:creator><pubDate>Fri, 24 Jun 2011 11:12:55 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 11:17:02 GMT]]></title><description><![CDATA[<p>Joscha__ schrieb:</p>
<blockquote>
<p>SeppJ schrieb:</p>
<blockquote>
<p>Ich persönlich würde das nicht empfehlen. Tutorials kenne ich kein einziges gutes und auch dieses ist eher ein (gutes) C-Tutorial mit cout statt printf. Buchtipps gibt's hier im Forum massenhaft Threads für.</p>
</blockquote>
<p>Es vermittelt aber ein Grundkenntniss an Funktionen, Schleifen und anderen Dinge.</p>
</blockquote>
<p>Das tun alle Lehrwerke. Da muss man sich dann nicht mit einem mittelmäßigen Rest des Tutorials zufrieden geben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083130</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 24 Jun 2011 11:17:02 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 11:46:46 GMT]]></title><description><![CDATA[<p>Danke an alle!</p>
<p>Ich melde mich, wenn ich wieder ein Problem habe.</p>
<p>Liebe Grüße<br />
David <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/2083150</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083150</guid><dc:creator><![CDATA[limos1]]></dc:creator><pubDate>Fri, 24 Jun 2011 11:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 16:43:15 GMT]]></title><description><![CDATA[<p><a href="http://www.if-schleife.de/" rel="nofollow">http://www.if-schleife.de/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083432</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083432</guid><dc:creator><![CDATA[is_doch_klar]]></dc:creator><pubDate>Fri, 24 Jun 2011 16:43:15 GMT</pubDate></item><item><title><![CDATA[Reply to If schleife? on Fri, 24 Jun 2011 16:51:49 GMT]]></title><description><![CDATA[<p>is_doch_klar schrieb:</p>
<blockquote>
<p><a href="http://www.if-schleife.de/" rel="nofollow">http://www.if-schleife.de/</a></p>
</blockquote>
<p>Wurde schon geposted...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2083434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2083434</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Fri, 24 Jun 2011 16:51:49 GMT</pubDate></item></channel></rss>