package PrimerS_1;
import java.util.Scanner;
public class PrimerS_1
{
public static void main(String[] args)
{
int rows = 3;
int cols = 4;
double[][] matrix = new double[rows][cols];
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++) {
matrix[i][j] = Math.random() * 10;
}
}
System.out.println("Исходная матрица:");
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++) {
System.out.printf("%.2f\t", matrix[i][j]);
}
System.out.println();
}
System.out.println("\nОкругленная матрица:");
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++) {
System.out.print(Math.round(matrix[i][j]) + "\t");
}
System.out.println();
}
}
}