<?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[Neuling]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich lerne gerade in der Technikerschule C++ und bin auch sofort auf ein Problem gestossen. Wir haben folgende Aufgabe bekommen:<br />
- Eine Funktion soll 10 Zahlen von Tastatur einlesen und anschließend den größten/kleinsten Wert ausgeben.</p>
<p>Ich habe mal wie folgt angefangen:</p>
<p>#include &quot;stdafx.h&quot;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;conio.h&gt;<br />
#include &lt;math.h&gt;</p>
<p>int _tmain(int argc, _TCHAR* argv[])<br />
{</p>
<p>int x,anzahl;<br />
double zahl,summe=0.0,mittelwert,klein=0,gross=0;</p>
<p>printf(&quot;\nWieviel Werte wollen Sie eingeben: &quot;);<br />
scanf(&quot;%i&quot;,&amp;anzahl);<br />
printf(&quot;\n&quot;);<br />
for(x=1; x&lt;=anzahl; x++)<br />
{<br />
printf(&quot;Bitte %i. Zahl eingeben: &quot;,x);<br />
scanf(&quot;%lf&quot;,&amp;zahl);<br />
//summe=summe+zahl;</p>
<p>}<br />
for(gross &gt; zahl;;)</p>
<p>//printf(&quot;\n\nSumme der Zahlen = %f&quot;,klein);<br />
printf(&quot;\nGroeste der Zahlen = %f&quot;,gross);</p>
<p>getch();</p>
<p>return 0;<br />
}</p>
<p>habe aber keine Ahnung wie ich weiter machen soll. Wenn ich den Mittelwert oder die Sunmme ausrechnen müßte das würde ich hinbekommen. Wir müßen die Aufgabe mithilfe von for, while oder do-Schleifen lösen, da wir gerade dieses Thema behandeln. Ich danke euch mal im Voraus für eure Hilfe............</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/250935/neuling</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 15:21:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/250935.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 26 Sep 2009 17:19:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:19:07 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich lerne gerade in der Technikerschule C++ und bin auch sofort auf ein Problem gestossen. Wir haben folgende Aufgabe bekommen:<br />
- Eine Funktion soll 10 Zahlen von Tastatur einlesen und anschließend den größten/kleinsten Wert ausgeben.</p>
<p>Ich habe mal wie folgt angefangen:</p>
<p>#include &quot;stdafx.h&quot;<br />
#include &lt;stdio.h&gt;<br />
#include &lt;conio.h&gt;<br />
#include &lt;math.h&gt;</p>
<p>int _tmain(int argc, _TCHAR* argv[])<br />
{</p>
<p>int x,anzahl;<br />
double zahl,summe=0.0,mittelwert,klein=0,gross=0;</p>
<p>printf(&quot;\nWieviel Werte wollen Sie eingeben: &quot;);<br />
scanf(&quot;%i&quot;,&amp;anzahl);<br />
printf(&quot;\n&quot;);<br />
for(x=1; x&lt;=anzahl; x++)<br />
{<br />
printf(&quot;Bitte %i. Zahl eingeben: &quot;,x);<br />
scanf(&quot;%lf&quot;,&amp;zahl);<br />
//summe=summe+zahl;</p>
<p>}<br />
for(gross &gt; zahl;;)</p>
<p>//printf(&quot;\n\nSumme der Zahlen = %f&quot;,klein);<br />
printf(&quot;\nGroeste der Zahlen = %f&quot;,gross);</p>
<p>getch();</p>
<p>return 0;<br />
}</p>
<p>habe aber keine Ahnung wie ich weiter machen soll. Wenn ich den Mittelwert oder die Sunmme ausrechnen müßte das würde ich hinbekommen. Wir müßen die Aufgabe mithilfe von for, while oder do-Schleifen lösen, da wir gerade dieses Thema behandeln. Ich danke euch mal im Voraus für eure Hilfe............</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784668</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:19:07 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:27:35 GMT]]></title><description><![CDATA[<p>Leg außerhalb der Schleife eine Variabel an die das Maximum beinhaltet. In der Schleife gehst du dann jede Zahl durch. Wenn die Zahl größer als das bisherige Maximum setzt du das Maximum auf den Wert der jeweilige Zahl. Wenn nicht tust du nichts. Am Ende der Schleife hast du dann das gesamte Maximum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784670</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784670</guid><dc:creator><![CDATA[Tobiking2]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:27:35 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:30:45 GMT]]></title><description><![CDATA[<p>1. Bitte bitte benutze in Zukunft etwas ausagekräftigere threadtitel! Danke.<br />
2. Was du da machst ist eher C. In C++ benutzt man cout und cin aus iostream zur ein bzw. ausgabe (auch die header sind alle aus C).</p>
<p>3. zu deinem problem: überleg mal ob du dir den bisher größten/kleinsten wert merken kannst. (Wie würdest du den die Aufgabe manuell lösen?)</p>
<p>Gruß<br />
Fencer</p>
<p>Ps: Deine main funktion ist nicht standardgemäß ([cpp]int main(int argc,char* argv[])</p>
<p>EDIT: Löst doch nicht immer Hausaufgaben für andere. Grad bei so einer Aufgabe ist der Lerneffekt dann gleich 0.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784671</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784671</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:30:45 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:28:19 GMT]]></title><description><![CDATA[<p>erste zahl merken, rest durchgehen und wenn eine zahl kleiner als die gemerkte ist diese merken</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784673</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784673</guid><dc:creator><![CDATA[ahahauhuhuh]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:28:19 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:31:04 GMT]]></title><description><![CDATA[<p>Am einfachsten wäre natürlich für jede Zahl eine Variable anzulegen und diese dann miteinander vergleichen. Aber dadurch würde denke ich der Code unnötig groß werden, und mit der Schleifenthematik beim Einlesen hat das auch nichts zu tun, oder ????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784674</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:31:04 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:33:09 GMT]]></title><description><![CDATA[<p>Lies mal genau durch was gesagt wurde! 2 vars genügen</p>
<p>btw: Aus Interesse: Lernt ihr diesen Stil (printf,scanf,deklaration von main...) bei euch in der Schule? <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/1784675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784675</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:33:09 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:34:29 GMT]]></title><description><![CDATA[<p>Ja Fencer, den Stil lernen wir................ Unsere Lehrerin hat sogar den Doktortitel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784676</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:37:40 GMT]]></title><description><![CDATA[<p>danke. (ist aber trotzdem eher C <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1784679</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784679</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:37:40 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:38:55 GMT]]></title><description><![CDATA[<p>Ja, wir haben auch mit c angefangen.<br />
Das mit dem Einlesen der Zahlen kann ich aber auch so lassen, oder ?????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784680</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784680</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:38:55 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:45:34 GMT]]></title><description><![CDATA[<p>Achso, ich war etwas verwirrt weil du C++ geschrieben hast.:)</p>
<p>wenn das in ordnung geht, kannst du es so lassen.</p>
<p>Ich hätte das aud diese Weise gemachtgemacht:</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;
....
int zahl;
cin&gt;&gt;zahl;//einlesen
cout&lt;&lt;zahl&lt;&lt;endl;//ausgeben
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1784681</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784681</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:45:34 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:49:28 GMT]]></title><description><![CDATA[<p>Jetzt ist es auch C++.</p>
<p>Und wie würdest Du dann weitermachen ? Ich steh grad echt voll auf dem Schlauch. Habe den ganzen Mittag gelernt und denke, dass da jetzt irgendwo ne Blokade ist.....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784684</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:49:28 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 17:56:18 GMT]]></title><description><![CDATA[<p>okay weil ich heute meinen guten tag hab und obwohl das schon 3 mal (!!!) gesagt wurde.</p>
<p>Definiere am anfang eine variable max und eine min.<br />
Schleife 10 mal:<br />
Zahl einlesen.<br />
Wenn größer als max /kleiner als min --&gt; max bzw. min ersetzen</p>
<p>nach der schleife:<br />
max und min ausgeben.</p>
<p>fertig. Code ist nicht im preis inbegriffen <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>
<p>Programmieraufwand: 5-30 minuten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784687</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 26 Sep 2009 17:56:18 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 18:23:21 GMT]]></title><description><![CDATA[<p>Danke Fencer,</p>
<p>meinst Du mit folgender Zeile:</p>
<p>Wenn größer als max /kleiner als min --&gt; max bzw. min ersetzen</p>
<p>das hier:</p>
<p>Wenn größer als max geteilt durch kleiner als min --&gt; max bzw. min ersetzen ,</p>
<p>oder wie meinst Du das genau ?????????????</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784688</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Sat, 26 Sep 2009 18:23:21 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 18:27:23 GMT]]></title><description><![CDATA[<p>Jetzt dachte ich das geht mit nem 4 Zeiler, aber wieso ist int einlesen so umständlich? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;set&gt;

int main()
{
	std::set&lt;int&gt; m;
	for(int i = 0;i&lt;10;i++){
		int n;
		std::cin&gt;&gt;n;
		m.insert(n);//gibts hier eigentlich nix um direkt nen int zu bekommen ohne ihn so umständlich mit &gt;&gt; rauszuholen?
	}
	std::cout&lt;&lt;&quot;min&quot;&lt;&lt;*m.begin()&lt;&lt;&quot;max&quot;&lt;&lt;*m.rbegin();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1784690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784690</guid><dc:creator><![CDATA[songram]]></dc:creator><pubDate>Sat, 26 Sep 2009 18:27:23 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 19:12:11 GMT]]></title><description><![CDATA[<p>/ ist als &quot;bzw.&quot; gemeint</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784702</guid><dc:creator><![CDATA[Fencer]]></dc:creator><pubDate>Sat, 26 Sep 2009 19:12:11 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 19:26:44 GMT]]></title><description><![CDATA[<p>Also mit 10 Werten hab ichs auch nicht kürzer hinbekommen...<br />
Hier braucht man halt STRG+Z um das eof anzugeben... (kA, was man in der Unix-Welt drücken müsste^^)</p>
<pre><code class="language-cpp">#include &lt;algorithm&gt;
#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;set&gt;

int main()
{
	std::set&lt;int&gt; values;
	values.insert(std::istream_iterator&lt;int&gt;(std::cin), std::istream_iterator&lt;int&gt;());
	std::cout &lt;&lt; &quot;min: &quot; &lt;&lt; *values.begin() &lt;&lt; &quot;; max: &quot; &lt;&lt; *values.rbegin() &lt;&lt; std::endl;
}
</code></pre>
<p>Es wäre einfach, wenn es copy_n gäbe - aber aus irgend nem Grund gibts das nicht... Aber hauptsache es gibt 20Milliarden replaces bei string...</p>
<pre><code class="language-cpp">#include &lt;algorithm&gt;
#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;vector&gt;

int main()
{
	std::vector&lt;int&gt; values;
	std::copy_n(std::istream_iterator&lt;int&gt;(std::cin), std::back_inserter(values), 10); //(src, dest, count)
	std::sort(values.begin(), values.end());
	std::cout &lt;&lt; &quot;min: &quot; &lt;&lt; *values.begin() &lt;&lt; &quot;; max: &quot; &lt;&lt; *values.rbegin() &lt;&lt; std::endl;
}
</code></pre>
<p>PS:<br />
ist hieran irgendwas falsch?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;set&gt;

int main()
{
	std::set&lt;int&gt; values(std::istream_iterator&lt;int&gt;(std::cin), std::istream_iterator&lt;int&gt;());
}
</code></pre>
<p>MSVC 9 schrieb:</p>
<blockquote>
<p>error C2751: 'std::cin' : the name of a function parameter cannot be qualified</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1784707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784707</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sat, 26 Sep 2009 19:26:44 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 19:34:52 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<p>PS:<br />
ist hieran irgendwas falsch?</p>
</blockquote>
<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-250511.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-250511.html</a> ist das selbe Problem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784709</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784709</guid><dc:creator><![CDATA[Ryuzaki]]></dc:creator><pubDate>Sat, 26 Sep 2009 19:34:52 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 19:47:54 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16305">@unskilled</a>: Mit std:sort schießt du weit über das Ziel hinaus, da nur Maximum und Minimum gesucht werden. Es gibt ja in algorithm auch Algorithmen dafür.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784713</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784713</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sat, 26 Sep 2009 19:47:54 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 19:55:56 GMT]]></title><description><![CDATA[<p>@Ryuzaki: ach ja - hatte ich so gar gelesen, aber schon wieder verdrängt^^<br />
<a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/19375">@SeppJ</a>: stimmt - hatte die aufgabenstellung schon wieder vergessen : D</p>
<p>also:</p>
<pre><code class="language-cpp">#include &lt;algorithm&gt;
#include &lt;iostream&gt;
#include &lt;iterator&gt;
#include &lt;vector&gt;

int main()
{
    std::vector&lt;int&gt; values;
    std::copy_n(std::istream_iterator&lt;int&gt;(std::cin), std::back_inserter(values), 10);
    std::cout &lt;&lt; &quot;min: &quot; &lt;&lt; *std::min_element(values.begin(), values.end())
            &lt;&lt; &quot;; max: &quot; &lt;&lt; *std::max_element(values.begin(), values.end()) &lt;&lt; std::endl;
}
</code></pre>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784717</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sat, 26 Sep 2009 19:55:56 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 20:07:36 GMT]]></title><description><![CDATA[<p>Ausgezeichnet, das sollte die Referenzlösung sein, wenn in ein paar Tagen der nächste diese Frage stellt. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1784726</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784726</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sat, 26 Sep 2009 20:07:36 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 20:17:15 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Ausgezeichnet, das sollte die Referenzlösung sein, wenn in ein paar Tagen der nächste diese Frage stellt. <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>
</blockquote>
<p>jopp - aber wie gesagt: das wäre nur die lösung, wenn es copy_n geben würde - wie in der original SGI STL library...<br />
für die lösung, die auch funktioniert habe ich ja set genommen^^</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784728</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sat, 26 Sep 2009 20:17:15 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 20:31:06 GMT]]></title><description><![CDATA[<p>danke für eure antworten. bin sehr überrascht, wieviele sich in dieses thema eingeklingt haben. aber leider dürfen wir das nur mit schleifen lösen,</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784734</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Sat, 26 Sep 2009 20:31:06 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 20:37:20 GMT]]></title><description><![CDATA[<p>Der Grund das sich so viele beteiligt haben ist der, dass hier im Forum normalerweise keine Hausaufgaben gemacht werden. Da eine ungelöste Aufgabe aber trotzdem in den Fingern juckt gibt es dann immer einen inoffiziellen Wettbewerb um die eleganteste Lösung. Diese sind dann ganz bewusst mit dermaßen fortgeschrittenen Sprachmitteln geschrieben, dass man sie nicht als Lösung für Hausaufgaben verwenden kann.</p>
<p>Die gezeigten Lösungen enthalten übrigens alle Schleifen. Diese sind nur sehr gut versteckt - wegen der Eleganz.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784736</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sat, 26 Sep 2009 20:37:20 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sat, 26 Sep 2009 20:48:16 GMT]]></title><description><![CDATA[<p>andy135 schrieb:</p>
<blockquote>
<p>danke für eure antworten. bin sehr überrascht, wieviele sich in dieses thema eingeklingt haben. aber leider dürfen wir das nur mit schleifen lösen,</p>
</blockquote>
<p>na dann bist du ja jetzt fast fertig:</p>
<pre><code class="language-cpp">#include &lt;algorithm&gt;
#include &lt;iostream&gt;

int main()
{
  int min, max;
  int tmp;
  std::cin &gt;&gt; tmp;
  min = max = tmp;
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);
  std::cin &gt;&gt; tmp;
  min = std::min(min, tmp);
  max = std::max(min, tmp);

  std::cout &lt;&lt; &quot;min: &quot; &lt;&lt; min &lt;&lt; &quot;; max: &quot; &lt;&lt; max &lt;&lt; std::endl;
}
</code></pre>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784741</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sat, 26 Sep 2009 20:48:16 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Sun, 27 Sep 2009 07:58:42 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<p>na dann bist du ja jetzt fast fertig:</p>
<pre><code class="language-cpp">#include &lt;algorithm&gt;
#include &lt;iostream&gt;

int main()
{
  //...
  max = std::max(min, tmp);  :warning:  :warning: 
  //...
}
</code></pre>
</blockquote>
<p>Aber auch nur fast :p</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1784800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1784800</guid><dc:creator><![CDATA[Phoemuex]]></dc:creator><pubDate>Sun, 27 Sep 2009 07:58:42 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling on Tue, 29 Sep 2009 21:01:05 GMT]]></title><description><![CDATA[<p>Hallo nochmals zusammen,</p>
<p>ich bin immer noch nicht weiter gekommen. Wie schaut denn diese Befehlsfolge in reinem C-Code aus ???????Also kein c++ oder sonstiges, sondern reiner C-Code........... Habe mal folgendermassen angefangen:</p>
<p>int zahl=0,zahl1=0;<br />
int zahlmax=0,zahlmin=0;<br />
int count;</p>
<p>for (count=1; count&lt;=9; count++)//Schleife leuft 9 mal + 1 die Erste Auffeorderung<br />
{<br />
printf(&quot;\n\tBitte geben Sie eine Zahl ein\t&quot;);<br />
scanf (&quot;%d&quot;,&amp;zahl);<br />
fflush(stdin);<br />
if (zahlmin&gt;=zahl);//zahlmin wird ausgeweartet<br />
zahlmin=zahl;<br />
else if (zahlmax&lt;=zahl);//zahlmax wird ausgeweartet<br />
zahlmax=zahl;</p>
<p>} //Ausgabe min und max Werte</p>
<p>printf(&quot;\n\n&quot;);<br />
printf (&quot;\tSie haben die kleinste Zahl: %.0lf \n\n&quot; ,zahlmin);<br />
printf (&quot;\tund die groeste Zahl: %.0lf eingetippt\n&quot; ,zahlmax);</p>
<p>Irgendwas ist da noch falsch, nur weiß ich nicht was......</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1786244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1786244</guid><dc:creator><![CDATA[andy135]]></dc:creator><pubDate>Tue, 29 Sep 2009 21:01:05 GMT</pubDate></item></channel></rss>