24 lines
459 B
Java
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("");
|
|
}
|
|
}
|
|
} |