APL/APL2.1/TP01/Grille/Grille.java
2022-02-07 17:26:04 +01:00

15 lines
440 B
Java

public class Grille {
public static void main(String[] args) {
int size = Integer.parseInt(args[0]);
for (int x = 0; x < size * 2 + 1; x++) {
for (int y = 0; y < size; y++) {
if (x % 2 == 0) System.out.print("+---");
else System.out.print("| ");
}
if (x % 2 == 0) System.out.println("+");
else System.out.println("|");
}
}
}