|
|
@ -0,0 +1,46 @@ |
|
|
|
import java.util.Scanner; |
|
|
|
|
|
|
|
class Main { |
|
|
|
|
|
|
|
//sudoku counts from 1 to 9 - sCount |
|
|
|
static final int SCOUNT = 9; |
|
|
|
|
|
|
|
static int field[][] = new int[SCOUNT][SCOUNT]; |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
while (true) { |
|
|
|
int[] transaction = readInput(); |
|
|
|
field[transaction[0]][transaction[1]] = transaction[2]; |
|
|
|
output(field); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static void output(int[][] field) { |
|
|
|
|
|
|
|
for (int i = 0; i < SCOUNT; i++) { |
|
|
|
for (int j = 0; j < SCOUNT; j++) { |
|
|
|
System.out.print(field[i][j] + " "); |
|
|
|
} |
|
|
|
System.out.println(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static int[] readInput() { |
|
|
|
|
|
|
|
Scanner scanner = new Scanner(System.in); |
|
|
|
String line = scanner.nextLine(); |
|
|
|
System.out.println(line); |
|
|
|
|
|
|
|
String substring = line.substring(line.indexOf('(')+1, line.indexOf(')')); |
|
|
|
String[] split = substring.split(","); |
|
|
|
|
|
|
|
int[] transaction = new int[split.length]; |
|
|
|
for (int i = 0; i < split.length; i++) { |
|
|
|
transaction[i] = Integer.valueOf(split[i]); |
|
|
|
} |
|
|
|
|
|
|
|
return transaction; |
|
|
|
} |
|
|
|
} |