import java.util.Scanner;
public class General {
public static void main(String[] args) {
// Чтение входных данных
System.out.println("Введите высоту матрицы");
Scanner in = new Scanner(System.in);
int rows = in.nextInt();
Double[][] arr = new Double [rows][rows+1];
Double[] iter = new Double[rows];
for (int i = 0; i < rows; i++){
for (int j = 0; j < rows + 1; j++){
System.out.println("Введите a[" + i + "][" + j + "]");
arr[i][j] = in.nextDouble();
}
}
System.out.println("Введите точность");
Double eps = in.nextDouble();
for (int i = 0; i < rows; i++){
for (int j = 0; j < rows + 1; j++){
System.out.print(arr[i][j]+ " ");
}
}
SimpleIterator Matrix = new SimpleIterator(eps, rows);
arr = Matrix.Normalization(arr);
boolean flag = Matrix.Convergence(arr);
int sp = Matrix.Iteration(eps);
System.out.println(sp);
}
}