DEV/DEV2.1/TP0:Introduction/Grille.java
2023-02-13 11:29:17 +01:00

24 lines
459 B
Java

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