-5
2-(顯示模式)收件的方法如下來顯示圖案:使用Java語言編寫的圖案
1
2 1
3 2 1
…
n n-1 … 3 2 1
方法簽名是public static void displayPattern(int n)
。用戶輸入他們想要圖案的時間長度。
我知道如何設置它,但不知道在該方法內使用什麼代碼。這是多遠我GOT-
Scanner input=new Scanner(System.in);
System.out.println("Please enter the num for how long the pattern is");
int n= input.nextInt();
}
public static void TheNum(int n){
}
掃描儀輸入=新的掃描儀(System.in); System.out.println(「請輸入模式花費多少時間的數字」); \t \t int n = input.nextInt(); \t \t \t} \t公共靜態無效TheNum(INT N){ \t \t \t \t \t \t \t \t \t \t \t \t \t} \t } –
這是我的C頌揚它搞砸了 –
這不符合***的嘗試***。請嘗試使用代碼先打印圖案。這是一個相對簡單的模式,我相信,如果你考慮一段時間,你肯定會得到解決問題的方法。 –