Java
This commit is contained in:
27
DEV2.1/TP01/Grille.java
Normal file
27
DEV2.1/TP01/Grille.java
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
public class Grille {
|
||||
public static void main(String[] args) {
|
||||
if (args[0] == "0") {
|
||||
return;
|
||||
}
|
||||
System.out.print("+");
|
||||
for (int i = 0; i != Integer.parseInt(args[0]); i++) {
|
||||
System.out.print("-+");
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
for(int j = 0; j != Integer.parseInt(args[0]); j++) {
|
||||
System.out.print("|");
|
||||
for (int i = 0; i != Integer.parseInt(args[0]); i++) {
|
||||
System.out.print(" |");
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
System.out.print("+");
|
||||
for (int i = 0; i != Integer.parseInt(args[0]); i++) {
|
||||
System.out.print("-+");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user