<?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[Max von Zahlen ausgeben]]></title><description><![CDATA[<p>Hallo Leute.Hab folgendes Problem: Ich will von 5 Zahlen die größte Zahl ermitteln.Leider ist dies nicht möglich, da ich den Fehler in meinem Quelltext nicht finde - es wird immer Null ausgegeben</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Max.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
  int i,a[6],m;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{

 for (i=1;i&lt;=5 ;i++ )
 {
   StringGrid1-&gt;Cells[0][i]=IntToStr(i);
 }

 {
	 StringGrid1-&gt;Cells[1][0]=&quot;Zahlen&quot; ;
 }

 for (i=1;i&lt;=5 ;i++ )
 {
   StringGrid2-&gt;Cells[0][i]=IntToStr(i);
 }

 {
	 StringGrid2-&gt;Cells[1][0]=&quot;Ergebnis&quot; ;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (i=1;i&lt;=5;i++ )
{a[i]=StrToInt(StringGrid1-&gt;Cells[1][i]);}

a[1]=m;
for (i=2;i&lt;=5 ;i++ );
{

  if (m&lt;a[i])
   {m=a[i];}

}
StringGrid2-&gt;Cells[1][1]=IntToStr(m);
}
</code></pre>
<p><strong>Edit:</strong><br />
Bitte die <a href="http://www.c-plusplus.net/forum/faq.php?mode=bbcode" rel="nofollow">Code-Tags</a> verwenden. Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/184944/max-von-zahlen-ausgeben</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 06:41:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/184944.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Jun 2007 14:12:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Max von Zahlen ausgeben on Wed, 20 Jun 2007 14:36:51 GMT]]></title><description><![CDATA[<p>Hallo Leute.Hab folgendes Problem: Ich will von 5 Zahlen die größte Zahl ermitteln.Leider ist dies nicht möglich, da ich den Fehler in meinem Quelltext nicht finde - es wird immer Null ausgegeben</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Max.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
  int i,a[6],m;

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{

 for (i=1;i&lt;=5 ;i++ )
 {
   StringGrid1-&gt;Cells[0][i]=IntToStr(i);
 }

 {
	 StringGrid1-&gt;Cells[1][0]=&quot;Zahlen&quot; ;
 }

 for (i=1;i&lt;=5 ;i++ )
 {
   StringGrid2-&gt;Cells[0][i]=IntToStr(i);
 }

 {
	 StringGrid2-&gt;Cells[1][0]=&quot;Ergebnis&quot; ;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (i=1;i&lt;=5;i++ )
{a[i]=StrToInt(StringGrid1-&gt;Cells[1][i]);}

a[1]=m;
for (i=2;i&lt;=5 ;i++ );
{

  if (m&lt;a[i])
   {m=a[i];}

}
StringGrid2-&gt;Cells[1][1]=IntToStr(m);
}
</code></pre>
<p><strong>Edit:</strong><br />
Bitte die <a href="http://www.c-plusplus.net/forum/faq.php?mode=bbcode" rel="nofollow">Code-Tags</a> verwenden. Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1309960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309960</guid><dc:creator><![CDATA[Kesselbuntes]]></dc:creator><pubDate>Wed, 20 Jun 2007 14:36:51 GMT</pubDate></item><item><title><![CDATA[Reply to Max von Zahlen ausgeben on Wed, 20 Jun 2007 14:53:10 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Der Code ist ja ganz schön durcheinander.<br />
Das größte Problem ist aber wohl das hier</p>
<pre><code class="language-cpp">a[1]=m;
</code></pre>
<p>sollte wohl eher so aussehen</p>
<pre><code class="language-cpp">m = a[1];
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1309998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1309998</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 20 Jun 2007 14:53:10 GMT</pubDate></item></channel></rss>