|
@ -6,22 +6,34 @@ class Main { |
|
|
static final int SCOUNT = 9; |
|
|
static final int SCOUNT = 9; |
|
|
|
|
|
|
|
|
static int field[][] = new int[SCOUNT][SCOUNT]; |
|
|
static int field[][] = new int[SCOUNT][SCOUNT]; |
|
|
|
|
|
int ar[] = new int[2]; |
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|
|
|
|
|
|
|
while (true) { |
|
|
|
|
|
int[] transaction = readInput(); |
|
|
|
|
|
|
|
|
while (true) { //das program läuft unendlich |
|
|
|
|
|
|
|
|
|
|
|
int[] transaction = readInput(); //starte die methode readinput und die soll werte zurückgeben |
|
|
|
|
|
|
|
|
|
|
|
//der erste wert von dem array transaction steht für die spalte und der zweite für die reihe und der dritte für den wert den man schreiben will |
|
|
field[transaction[0]][transaction[1]] = transaction[2]; |
|
|
field[transaction[0]][transaction[1]] = transaction[2]; |
|
|
|
|
|
|
|
|
|
|
|
//gebe das gespeicherte feld auf der console aus |
|
|
output(field); |
|
|
output(field); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static void output(int[][] field) { |
|
|
private static void output(int[][] field) { |
|
|
|
|
|
|
|
|
for (int i = 0; i < SCOUNT; i++) { |
|
|
for (int i = 0; i < SCOUNT; i++) { |
|
|
|
|
|
|
|
|
for (int j = 0; j < SCOUNT; j++) { |
|
|
for (int j = 0; j < SCOUNT; j++) { |
|
|
|
|
|
|
|
|
System.out.print(field[i][j] + " "); |
|
|
System.out.print(field[i][j] + " "); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
System.out.println(); |
|
|
System.out.println(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -34,6 +46,7 @@ class Main { |
|
|
System.out.println(line); |
|
|
System.out.println(line); |
|
|
|
|
|
|
|
|
String substring = line.substring(line.indexOf('(')+1, line.indexOf(')')); |
|
|
String substring = line.substring(line.indexOf('(')+1, line.indexOf(')')); |
|
|
|
|
|
|
|
|
String[] split = substring.split(","); |
|
|
String[] split = substring.split(","); |
|
|
|
|
|
|
|
|
int[] transaction = new int[split.length]; |
|
|
int[] transaction = new int[split.length]; |
|
|