如何使用progress4gl框架显示一个或多个三角形图案的数字?请帮帮我。
。
1 OR 1
1 1 1 1 2 3
1 1 1 1 1 1 2 3 4 5
1 1 1 1 1 1 1. 1 2 3 4 5 6 7
对用例非常好奇....但是:
DEFINE VARIABLE i AS INTEGER NO-UNDO .
DO i = 1 TO 5:
DISPLAY FILL (" ", (6 - i) * 2) + FILL ("1 ", i * 2 - 1) FORMAT "x(40)" WITH DOWN STREAM-IO.
DOWN 1.
END.
接近。
DEFINE VARIABLE i AS INTEGER NO-UNDO .
DEFINE VARIABLE j AS INTEGER NO-UNDO .
DEFINE VARIABLE cLine AS CHARACTER FORMAT "x(40)" NO-UNDO.
DO i = 1 TO 5:
cLine = FILL (" ", (6 - i) ) .
DO j = 1 TO i:
cLine = cLine + STRING (j * 2 - 1) + " ".
END.
DISPLAY cLine WITH DOWN STREAM-IO.
DOWN 1.
END.