SPACE函式可能沒考慮到DIM,今天來挑戰看看
10 CLS
15 DIM N(3)
16 FOR I=1 TO 3
20 INPUT "輸入數字: ",N(I)
21 NEXT I
22 FOR L=1 TO 3
30 A=1:B=10:C=2
40 FOR K=1 TO 2
50 FOR I=A TO B STEP C
60 PRINT SPACE(N(L));
70 FOR J=1 TO I
80 PRINT "*";
90 NEXT J
100 PRINT
110 IF K=1 N(L)=N(L)-1 ELSE N(L)=N(L)+1
120 NEXT I
130 A=9:B=1:N(L)=1:C=-2
140 NEXT K
150 NEXT L
輸入數字: 5
輸入數字: 10
輸入數字: 15
*
***
*****
*******
*********
***********
*********
*******
*****
***
*
*
***
*****
*******
*********
***********
*********
*******
*****
***
*
*
***
*****
*******
*********
***********
*********
*******
*****
***
*
|