我必须制作一个程序,要求用户输入高度和长度(均为偶数),然后程序将绘制一个房子.房子的屋顶是(宽度/ 2)行数.示例程序应如下所示:
Enter height and width of the house you want me to draw (must be even numbers): 10 10
....**
.../..\
../....\
./......\
/........\
----------
|........|
|........|
|........|
|........|
|........|
|........|
|........|
|........|
|........|
|........|
----------
但这是我一直只为屋顶得到的,使用10和10的宽度和高度(我还没有开始身体):
height: 10
width: 10
....**
.../..\
.../..\
.../..\
.../..\
----------
有谁知道如何放置正确的空间以使其看起来像样品?我的代码是:
import java.util.Scanner;
public class QuestionCode {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int height &