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