public class Question {
public static void main(String
[] args
) {
int lines
= 6;
int[] a
= new int[lines
+ 1];
int previous
= 1;
for (int i
= 1; i
<= lines
; i
++){
for (int j
= lines
; j
> i
; j
--) {
System
.out
.print(" ");
}
for (int j
= 1; j
<= i
; j
++){
int current
= a
[j
];
a
[j
] = previous
+ current
;
previous
= current
;
System
.out
.print(a
[j
] + " ");
}
System
.out
.println();
}
}
转载请注明原文地址:https://tech.qufami.com/read-18930.html