Skip to content

Instantly share code, notes, and snippets.

@daemonfire300
Created June 30, 2012 19:09
Show Gist options
  • Save daemonfire300/3025132 to your computer and use it in GitHub Desktop.
Save daemonfire300/3025132 to your computer and use it in GitHub Desktop.
sdsdgsdg
class matrixweteaddieren {
public static void main (String [] args) {
double [] [] m = {
{ 7.2, 4.3, 8.0, 3.3},
{ 4.1, 5.0, 1.0, 9.0},
{ 1.0, 3.0, 3.2, 2.4} };
double sum = 0.0;
for (int i = 0; i < m.length; i++)
{
for (int j = 0; j < m [j].length; j++)
{
sum = sum + m[i] [j];
}
}
System.out.println ("Summe der Matrixelemente:" + sum);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment