```java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("请输入一个数字X:");
double x = scanner.nextDouble();
double[][] matrix = constructMatrix(x);
System.out.println("构造的三阶行列式为:");
printMatrix(matrix);
}
public static double[][] constructMatrix(double x) {
double[][] matrix = new double[3][3];
matrix[0][0] = x;
matrix[1][1] = x;
matrix[2][2] = x * (1 - x);
return matrix;
}
public static void printMatrix(double[][] matrix) {
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix[i].length; j++) {
System.out.print(matrix[i][j] + "\t");
}
System.out.println();
}
}
}
```
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("请输入一个数字X:");
double x = scanner.nextDouble();
double[][] matrix = constructMatrix(x);
System.out.println("构造的三阶行列式为:");
printMatrix(matrix);
}
public static double[][] constructMatrix(double x) {
double[][] matrix = new double[3][3];
matrix[0][0] = x;
matrix[1][1] = x;
matrix[2][2] = x * (1 - x);
return matrix;
}
public static void printMatrix(double[][] matrix) {
for (int i = 0; i < matrix.length; i++) {
for (int j = 0; j < matrix[i].length; j++) {
System.out.print(matrix[i][j] + "\t");
}
System.out.println();
}
}
}
```