Enter edge length of your rhomboid: 5
Here is your rhomboid:
*****
*****
*****
*****
*****
我需要用扫描仪打印菱形图。我得到这样的:* * * * * *
在日食中使用扫描仪打印菱形图
我的代码是这样的,通常我不坏,但我也没有做的第一行:
import java.util.Scanner;
public class rhomboid {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter edge lenght of your rhomboid: ");
int edgelenght = scan.nextInt();
System.out.println("Here is your rhomboid:");
while(edgelenght > 0){
System.out.print(" ");
System.out.print("*");
edgelenght--;
你可以发布你的当前代码吗? – Tunaki