Professional Documents
Culture Documents
Transpuesta
Transpuesta
Scanner;
class TransposeAMatrix
{
public static void main(String args[])
{
int m, n, c, d;
System.out.print("\n");
}
}
}
import java.util.Scanner;
/*
* Java Program to transpose a Matrix. When you transpose
* a matrix rows are replaced by columns. For example,
* The transpose of a matrix is a new matrix whose rows are the columns of the
original.
*/
public class MatrixTransposeDemo {
/*
* Java class to represent a Matrix. It uses a two dimensional array to
* represent a Matrix.
*/
class Matrix {
private int rows;
private int columns;
private int[][] data;
/**
* fills matrix from data entered by user in console
*
* @param rows
* @param columns
*/
public void read(Scanner s) {
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
data[i][j] = s.nextInt();
}
}
}
/**
* This method will transpose this matrix
*
* @return
*/
public void transpose() {
int[][] temp = new int[columns][rows];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
temp[j][i] = data[i][j];
}
}
data = temp;
}
/**
*
* @param matrix
*/
public void print() {
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
System.out.print(data[i][j] + " ");
}
System.out.println();
}
}
Cordial Saludo,
La suma de los elementos de la columna (total_columna) está por encima del promedio
de los totales de todas las
columnas pares.
[5, 3, 8]
[1, 2, 4]
[9, 7, 6]
======
[15,12,18]
=======
{NUMERO_CEDULA}_{NOMBRES}_{FECHA_DE_DILIGENCIAMIENTO}.{Extension}
Ejemplos:
1010421945_JUAN-PABLO-PEREZ_2018-03-50-14-50.java
1010421945_JUAN-PABLO-PEREZ_2018-03-50-14-50.ts
1010421945_JUAN-PABLO-PEREZ_2018-03-50-14-50.js
1010421945_JUAN-PABLO-PEREZ_2018-03-50-14-50.py
1010421945_JUAN-PABLO-PEREZ_2018-03-50-14-50.php