-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颂扬它搞砸了 –
这不符合***的尝试***。请尝试使用代码先打印图案。这是一个相对简单的模式,我相信,如果你考虑一段时间,你肯定会得到解决问题的方法。 –