<?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[Ein Wort Stück für Stück ausgeben]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich bräuchte Hilfe zu einem Programm, welches ich in der Schule ertellen soll:</p>
<p>Wir sollen mit string ein Prog schreiben, welches mir z.B. das Wort &quot;HALLO&quot; folgendermaßen ausgibt:</p>
<p>H<br />
HA<br />
HAL<br />
HALL<br />
HALLO<br />
HALL<br />
HAL<br />
HA<br />
H</p>
<p>Wäre super wenn mir da jemand helfen könnte!<br />
Ich weiß nicht wie ich an den Programmcode ran gehen soll...</p>
<p>Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/216628/ein-wort-stück-für-stück-ausgeben</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 06:11:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/216628.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Jun 2008 08:03:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ein Wort Stück für Stück ausgeben on Thu, 26 Jun 2008 08:03:57 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich bräuchte Hilfe zu einem Programm, welches ich in der Schule ertellen soll:</p>
<p>Wir sollen mit string ein Prog schreiben, welches mir z.B. das Wort &quot;HALLO&quot; folgendermaßen ausgibt:</p>
<p>H<br />
HA<br />
HAL<br />
HALL<br />
HALLO<br />
HALL<br />
HAL<br />
HA<br />
H</p>
<p>Wäre super wenn mir da jemand helfen könnte!<br />
Ich weiß nicht wie ich an den Programmcode ran gehen soll...</p>
<p>Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1536067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1536067</guid><dc:creator><![CDATA[Jojo0815]]></dc:creator><pubDate>Thu, 26 Jun 2008 08:03:57 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Wort Stück für Stück ausgeben on Thu, 26 Jun 2008 08:11:20 GMT]]></title><description><![CDATA[<p>das sind lediglich zwei schleifen hintereinander. Die erste zählt von 1 bis zur Länge des Strings, die andere anders herum. du machst dann nen cout auf einen substring (string::substr()) und gut ist</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1536069</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1536069</guid><dc:creator><![CDATA[DocJunioR]]></dc:creator><pubDate>Thu, 26 Jun 2008 08:11:20 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Wort Stück für Stück ausgeben on Thu, 26 Jun 2008 12:33:42 GMT]]></title><description><![CDATA[<p>hab heute meinen sozialen tag...</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;
using namespace std;

void putText(string const&amp; text)
{
   int i;
   for(i = 0; i &lt; text.length(); ++i)
       cout &lt;&lt; text.substr(0, i) &lt;&lt; endl;
   for(i = text.length()-1; i &gt;= 0; --i)
       cout &lt;&lt; text.substr(text.length()-1, i) &lt;&lt; endl;
}
</code></pre>
<p>bin mir nicht sicehr wie das mit legnth() aussieht ob man da noch wie gemacht einen abziehn muss oder obs reicht wenn man length() nimmt...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1536323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1536323</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Thu, 26 Jun 2008 12:33:42 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Wort Stück für Stück ausgeben on Thu, 26 Jun 2008 12:47:52 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;
using namespace std;

void putText(string const&amp; text)
{
   int i;
   for(i = 0; i &lt; text.length(); ++i)
       cout &lt;&lt; text.substr(0, i) &lt;&lt; endl;
   for(i = text.length()-1; i &gt;= 0; --i)
       cout &lt;&lt; text.substr(text.length()-1, i) &lt;&lt; endl;
}
</code></pre>
<p>bin mir nicht sicehr wie das mit legnth() aussieht ob man da noch wie gemacht einen abziehn muss oder obs reicht wenn man length() nimmt...</p>
</blockquote>
<pre><code class="language-cpp">void putText(string const&amp; text)
{
   int i;
   for(i = 0; i &lt;= text.length(); ++i)
       cout &lt;&lt; text.substr(0, i) &lt;&lt; endl;
   for(i = text.length(); i &gt;= 0; --i)
       cout &lt;&lt; text.substr(text.length(), i) &lt;&lt; endl;
}
</code></pre>
<p>In der ersten Schleife muss es &lt;= nicht &lt; heißen!<br />
Und das -1 kannst du dir auch Sparen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1536336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1536336</guid><dc:creator><![CDATA[@Work]]></dc:creator><pubDate>Thu, 26 Jun 2008 12:47:52 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Wort Stück für Stück ausgeben on Thu, 26 Jun 2008 16:49:58 GMT]]></title><description><![CDATA[<p>deswegen meinte ich ja ich bin mir nicht sicher was length() zurückgibt</p>
<p>hab den ganzen spass jez nich im kopf und will auch nicht dauernd die compiler und so starten...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1536537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1536537</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Thu, 26 Jun 2008 16:49:58 GMT</pubDate></item></channel></rss>