APL/APL2.1/TP01/Grille/Grille.java

15 lines
440 B
Java
Raw Normal View History

2022-02-07 17:26:04 +01:00
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("|");
}
}
}