Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 1, 2021 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/58fd2dc935d58c59ae1819c2b964456a to your computer and use it in GitHub Desktop.
Save parzibyte/58fd2dc935d58c59ae1819c2b964456a to your computer and use it in GitHub Desktop.
// Después imprimir los encabezados
System.out.println("\t\t\t1\t\t\t\t\t2\t\t\t\tSuma");
for (int x = 0; x < 62; x++) {
System.out.print("_");
}
System.out.println();
// Finalmente imprimir los resultados
for (int y = 0; y < matriz1.length; y++) {
for (int x = 0; x < matriz1[y].length; x++) {
System.out.printf("%5d ", matriz1[y][x]);
}
System.out.print(" | ");
for (int x = 0; x < matriz2[y].length; x++) {
System.out.printf("%5d ", matriz2[y][x]);
}
System.out.print(" | ");
for (int x = 0; x < matrizSuma[y].length; x++) {
System.out.printf("%5d ", matrizSuma[y][x]);
}
System.out.print(" | ");
System.out.println();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment