<?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[wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten.]]></title><description><![CDATA[<p>ich verstehe nicht was in der Angabe genau gemeint ist, oder interpretiere ich so wie es gefragt ist?<br />
**Lesen Sie 2 2x2 Matrizen ein und geben Sie das Produkt der beiden Matrizen aus. Legen Sie das Programm so aus, dass der Benutzer beliebig viele Matrizenmultiplikationen ausführen kann, ohne das Programm mehrmals zu starten. Verwenden Sie in Ihrem Programm zur Speicherung der Matrizen maximal 3 Variable.<br />
**</p>
<p>das ist mein Code, aber multiplikation stimmt nicht. Irgendwo in der Schleife habe ich fehler <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>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main(){

	int matrix1 [2][2];
	int matrix2 [2][2];
	int ausgabematrix[2][2];

	for(int i = 0; i &lt; 2 ; i++){
		for(int j = 0; j &lt; 2; j++){
			cin &gt;&gt; matrix1[i][j];
		}
	}

	for(int i = 0; i &lt; 2 ; i++){
		for(int j = 0; j &lt; 2; j++){
			cin &gt;&gt; matrix2[i][j];
		}
	}

	cout &lt;&lt; &quot;1. Matrix ist : &quot; &lt;&lt; endl;

	for(int i = 0; i &lt; 2; i++){
		for(int j = 0; j &lt; 2; j++){
			cout &lt;&lt; matrix1[i][j] &lt;&lt; &quot; &quot;;		
		}
			cout &lt;&lt; '\n';
	}

	cout &lt;&lt; &quot;2. Matrix ist : &quot; &lt;&lt; endl;	

	for(int i = 0; i &lt; 2; i++){
		for(int j = 0; j &lt; 2; j++){
			cout &lt;&lt; matrix2[i][j]&lt;&lt; &quot; &quot;;
		}
			cout &lt;&lt; '\n';
	}
	cout &lt;&lt; &quot;--------&quot; &lt;&lt; ;
	for( int i = 0; i &lt; 2; i++){
		for(int j = 0; j &lt; 2; j++){
			int result = 0;
			for(int k = 0; k &lt; 2; k++){
				result = matrix1[i][k]*matrix2[k][j];

			}
				ausgabematrix[i][j] = result;
			cout &lt;&lt; ausgabematrix[i][j]&lt;&lt; &quot; &quot;; 

		}

			cout &lt;&lt; endl;
	}

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/306489/wie-kann-man-beliebig-viele-matrizenmultiplikationen-ausführen-ohne-das-programm-mehrmals-zu-starten</link><generator>RSS for Node</generator><lastBuildDate>Sat, 08 Aug 2026 07:36:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/306489.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Jul 2012 14:35:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 14:35:50 GMT]]></title><description><![CDATA[<p>ich verstehe nicht was in der Angabe genau gemeint ist, oder interpretiere ich so wie es gefragt ist?<br />
**Lesen Sie 2 2x2 Matrizen ein und geben Sie das Produkt der beiden Matrizen aus. Legen Sie das Programm so aus, dass der Benutzer beliebig viele Matrizenmultiplikationen ausführen kann, ohne das Programm mehrmals zu starten. Verwenden Sie in Ihrem Programm zur Speicherung der Matrizen maximal 3 Variable.<br />
**</p>
<p>das ist mein Code, aber multiplikation stimmt nicht. Irgendwo in der Schleife habe ich fehler <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>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main(){

	int matrix1 [2][2];
	int matrix2 [2][2];
	int ausgabematrix[2][2];

	for(int i = 0; i &lt; 2 ; i++){
		for(int j = 0; j &lt; 2; j++){
			cin &gt;&gt; matrix1[i][j];
		}
	}

	for(int i = 0; i &lt; 2 ; i++){
		for(int j = 0; j &lt; 2; j++){
			cin &gt;&gt; matrix2[i][j];
		}
	}

	cout &lt;&lt; &quot;1. Matrix ist : &quot; &lt;&lt; endl;

	for(int i = 0; i &lt; 2; i++){
		for(int j = 0; j &lt; 2; j++){
			cout &lt;&lt; matrix1[i][j] &lt;&lt; &quot; &quot;;		
		}
			cout &lt;&lt; '\n';
	}

	cout &lt;&lt; &quot;2. Matrix ist : &quot; &lt;&lt; endl;	

	for(int i = 0; i &lt; 2; i++){
		for(int j = 0; j &lt; 2; j++){
			cout &lt;&lt; matrix2[i][j]&lt;&lt; &quot; &quot;;
		}
			cout &lt;&lt; '\n';
	}
	cout &lt;&lt; &quot;--------&quot; &lt;&lt; ;
	for( int i = 0; i &lt; 2; i++){
		for(int j = 0; j &lt; 2; j++){
			int result = 0;
			for(int k = 0; k &lt; 2; k++){
				result = matrix1[i][k]*matrix2[k][j];

			}
				ausgabematrix[i][j] = result;
			cout &lt;&lt; ausgabematrix[i][j]&lt;&lt; &quot; &quot;; 

		}

			cout &lt;&lt; endl;
	}

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2236952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236952</guid><dc:creator><![CDATA[nata]]></dc:creator><pubDate>Mon, 30 Jul 2012 14:35:50 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 14:44:08 GMT]]></title><description><![CDATA[<p>Konntest du bei deiner Fehlersuche denn den Fehler genauer lokalisieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236954</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Mon, 30 Jul 2012 14:44:08 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 14:47:33 GMT]]></title><description><![CDATA[<p>result <strong>+</strong>= matrix1[i][k]*matrix2[k][j];<br />
Und schreib doch besser Funktionen für die Ausgabe, statt den Code die ganze Zeite zu kopieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236957</guid><dc:creator><![CDATA[Jockelx]]></dc:creator><pubDate>Mon, 30 Jul 2012 14:47:33 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 14:51:30 GMT]]></title><description><![CDATA[<p>Man koennte doch (mein Ansatz) eine Klasse fuer Matrizen schreiben und die Streaming-Operatoren dafuer ueberladen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236959</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Mon, 30 Jul 2012 14:51:30 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 14:56:27 GMT]]></title><description><![CDATA[<p>Beliebig viele Matrizenmultiplikationen heißt für mich, dass du eine Schleife bauen musst, in der der Benutzer gefragt wird, ob er weiter machen will oder nicht.</p>
<pre><code class="language-cpp">char ch = 'j';
while(ch == 'j')
{
//
//
std::cout&lt;&lt;&quot;Weitermachen? j fuer weiter.\n;
std::cin&gt;&gt;ch;
}
</code></pre>
<p>Eventuell wäre noch denkbar, eine Abfrage zu machen, ob mit der aktuellen Matrize weitergerechnet werden soll oder ob zwei neue matrizen eingelesen werden sollen.</p>
<p>gruß<br />
syntax</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236960</guid><dc:creator><![CDATA[Syntax_error]]></dc:creator><pubDate>Mon, 30 Jul 2012 14:56:27 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 15:10:32 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/28547">@Sone</a>: ich lerne Programmieren schritt für schritt und ich bin erst im Stoff bei Array und Zeiger</p>
<p>ja aber wo es in der Angabe steht, dass man für die Speicherung der Matrixen maximum 3 Variablen nützen kann und falls ich eine Abfrage mache, ob ich weitermachen soll, dann muss ich doch eine 4.Variable nehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236966</guid><dc:creator><![CDATA[nata]]></dc:creator><pubDate>Mon, 30 Jul 2012 15:10:32 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 15:14:54 GMT]]></title><description><![CDATA[<p>[quote=&quot;nata&quot;] Verwenden Sie in Ihrem Programm zur Speicherung der Matrizen maximal 3 Variable.<br />
[/b]<br />
Du speicherst in dieser Variable für die Schleife ja keine Matrizen. Also gehts für mich ok.</p>
<p>gruß<br />
syntax</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236970</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236970</guid><dc:creator><![CDATA[Syntax_error]]></dc:creator><pubDate>Mon, 30 Jul 2012 15:14:54 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 15:34:14 GMT]]></title><description><![CDATA[<p>also du meinst meine ganze for schleifen in while schleife einpacken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236980</guid><dc:creator><![CDATA[nata]]></dc:creator><pubDate>Mon, 30 Jul 2012 15:34:14 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 15:50:27 GMT]]></title><description><![CDATA[<p>oder in<br />
do{</p>
<p>}while(1);</p>
<p>da einpacken</p>
<p>Wie ich richtig verstanden habe es soll endlos schleife sein und abbruch nur mit ctrl + c</p>
<p>ich habe versucht so und es funktioniert so, dass man 2 neue Matrixen eingeben muss, aber falls man produkt mit neue matrix multiplizieren soll, muss man nicht 4. Variable für Matrix einführen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236984</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236984</guid><dc:creator><![CDATA[nata]]></dc:creator><pubDate>Mon, 30 Jul 2012 15:50:27 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 15:50:45 GMT]]></title><description><![CDATA[<p>nata schrieb:</p>
<blockquote>
<p>oder in<br />
do{</p>
<p>}while(1);</p>
<p>da einpacken</p>
<p>Wie ich richtig verstanden habe es soll endlos schleife sein und abbruch nur mit ctrl + c</p>
</blockquote>
<p>Du kannst auch einfach</p>
<pre><code class="language-cpp">for(;;)
{
...
</code></pre>
<p>nehmen... aber das ist jetzt auch egal. Konzentrier dich aufs wesentliche.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236989</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236989</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Mon, 30 Jul 2012 15:50:45 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 16:08:03 GMT]]></title><description><![CDATA[<p>danke.</p>
<p>Respekt gegenüber euch allen.<br />
Ich habe ganzen tag gebraucht um 2 kleine Codes zu schreiben <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="😞"
    /><br />
mein Gehirn kocht<br />
ich höffe irgendwann wir schneller gehen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2236994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2236994</guid><dc:creator><![CDATA[nata]]></dc:creator><pubDate>Mon, 30 Jul 2012 16:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 17:38:06 GMT]]></title><description><![CDATA[<p>Jockelx schrieb:</p>
<blockquote>
<p>result <strong>+</strong>= matrix1[i][k]*matrix2[k][j];<br />
Und schreib doch besser Funktionen für die Ausgabe, statt den Code die ganze Zeite zu kopieren.</p>
</blockquote>
<p>es wird doch wert von result immer wieder auf 0 gesetzt. deine Lösung stimmt wirklich aber warum ist verschiedene ergebnisse wenn man result += matrix1[i][k]*matrix2[k][j] und result = matrix1[i][k]*matrix2[k][j] eingibt?</p>
<p>noch dazu diese Algorithmus habe ich von andere Forumsbeitrag. Irgendwie kapiere ich nicht wie man darauf kommt und alleine wurde ich sicher nicht darauf kommen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2237017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2237017</guid><dc:creator><![CDATA[nata]]></dc:creator><pubDate>Mon, 30 Jul 2012 17:38:06 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Mon, 30 Jul 2012 17:27:58 GMT]]></title><description><![CDATA[<p>nata schrieb:</p>
<blockquote>
<p>es wird doch wert von result immer wieder auf 0 gesetzt.</p>
</blockquote>
<p>Nicht innerhalb der k-Schleife. Und das ist auch gut so, denn sonst würde das Ergebnis nicht stimmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2237021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2237021</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 30 Jul 2012 17:27:58 GMT</pubDate></item><item><title><![CDATA[Reply to wie kann man beliebig viele Matrizenmultiplikationen ausführen ohne das Programm mehrmals zu starten. on Tue, 31 Jul 2012 07:20:39 GMT]]></title><description><![CDATA[<p>nata schrieb:</p>
<blockquote>
<p>warum ist verschiedene ergebnisse wenn man result += matrix1[i][k]*matrix2[k][j] und result = matrix1[i][k]*matrix2[k][j] eingibt?</p>
</blockquote>
<p>ist dir klar, was der &quot;+=&quot;-Operator macht?</p>
<p>nata schrieb:</p>
<blockquote>
<p>noch dazu diese Algorithmus habe ich von andere Forumsbeitrag. Irgendwie kapiere ich nicht wie man darauf kommt und alleine wurde ich sicher nicht darauf kommen</p>
</blockquote>
<p>das ist die übliche Matrizenmultiplikation...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2237181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2237181</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Tue, 31 Jul 2012 07:20:39 GMT</pubDate></item></channel></rss>