Package Cn.dlpu.lby;
Import Java.util.Scanner;
/* Spell out beautiful forms * in the Chinese Windows Environment, the console window can also be used to spell beautiful tables with special symbols. For example: ┌─┬─┐│││├─┼─┤│││└─┴─┘ Actually, it is by the following symbol splicing: Left upper =┌ Upper =┬ right Upper =┐ left =├ center =┼ right =┤ lower left =└
┴ right down =┘ vertical =│ level =─ This topic requires a program to draw the corresponding table according to the number of rows and columns entered by the user. For example user input: 3 2 program output: ┌─┬─┐│││├─┼─┤│││├─┼─┤│││└─┴─┘ user input: 2 3 program output: ┌─┬─┬─┐││││├─┼─┼─┤││ ││└─┴─┴─┘ requires candidates to write all classes in a file. After debugging, deposit with the candidate folder corresponding to the "answer. txt" in the title can be. The relevant engineering documents should not be copied into.
Please do not use the package statement. In addition, only the syntax or invocation allowed in JDK1.5 can appear in the source program.
You cannot use version 1.6 or later.
*/public class Pingezi {public static void main (string[] args) {Scanner sc = new Scanner (system.in);
int n = sc.nextint ();
int m = Sc.nextint ();
Display (n, m);
} private static void display (int n, int m) {//TODO auto-generated method stub for (int i = 0; I <= N; i++) {
for (int j = 0; J <= M; j + +) {if (i = = 0) {//First line if (j = = 0) System.out.print ("┌─");
else if (J > 0 && J < m) {System.out.print ("┬─");
} else {System.out.println ("┐");
Add (j);
}}//middle row else if (i > 0 && i < n) {if (j = = 0) {System.out.print ("├─");
} else if (J > 0 && J < m) {System.out.print ("┼─");
} else{System.out.println ("┤");
Add (j);
}}//Last line else{if (j = = 0) {System.out.print ("└─");
} else if (J > 0 && J < m) {System.out.print ("┴─");
} else System.out.print ("┘");
}}}} private static void Add (int j) {//TODO auto-generated method stub for (int i = 0; i < J; i++) {
System.out.print ("│");
} System.out.println ("│");
}
}