Created
June 12, 2014 14:54
-
-
Save meyerzinn/96c539de0438a7abfc6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int a[][] = new int[3][5]; | |
a[0][0] = 1; | |
a[0][1] = 2; | |
a[0][2] = 3; | |
a[0][3] = 5; | |
a[1][0] = 4; | |
a[1][1] = 5; | |
a[1][2] = 6; | |
a[1][3] = 7; | |
a[2][0] = 3; | |
a[2][1] = 9; | |
a[2][2] = 4; | |
a[2][3] = 1; | |
int i; | |
int j; | |
for (i = 0; i < a.length; i++) { | |
int sum = 0; | |
for (j = 0; j < a[i].length; j++) { | |
sum = sum + a[i][j]; | |
System.out.print(" " + a[i][j]); | |
} | |
System.out.println(" = " + sum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment