package
com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
System.out.println("Массив");
System.out.println(" ");
System.out.println("Введите число: ");
Scanner a = new Scanner(
System.in);
System.out.println("Введите порядковый номер строки: ");
Scanner b = new Scanner(
System.in);
System.out.println("Введите порядковый номер столбца: ");
Scanner v = new Scanner(
System.in);
int c = a.nextInt();
int d = b.nextInt();
int w = v.nextInt();
int i, j, k = 1;
int twoD[][] = new int[4][4];
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++){
twoD[i][j] = k;
k++;
}
for (i = 0; i < 4; i++){
for (j = 0; j < 4; j++) {
if(i == d && j == w){
twoD[d][w] = c;
System.out.print(twoD[d][w] + " ");
} else {
System.out.print(twoD[i][j] + " ");
}
}
System.out.println();
}}
}