用QBASIC语言编程图形.求公式详解.求高手详解,谢谢了.**********for a 1 to 4for b 1 to 4print “*”;if b = a then exit fornextprintnext

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 15:49:12

用QBASIC语言编程图形.求公式详解.求高手详解,谢谢了.**********for a 1 to 4for b 1 to 4print “*”;if b = a then exit fornextprintnext
用QBASIC语言编程图形.求公式详解.求高手详解,谢谢了.
*
**
***
****
for a 1 to 4
for b 1 to 4
print “*”;
if b = a then exit for
next
print
next

用QBASIC语言编程图形.求公式详解.求高手详解,谢谢了.**********for a 1 to 4for b 1 to 4print “*”;if b = a then exit fornextprintnext
你的答案有错误,我帮你改了.
cls
for a= 1 to 4 '循环4次,每次打一行
for b= 1 to 4 '最多4次,每次打一个*
print “*”;'紧凑格式打一个*,光标不换行
if b = a then exit for '如果这一行的*个数够了就结束本行
next
print '光标换新行
next

此题最好的做法如下:
CLS
FOR A=1 TO 4
FOR B=1 TO A
PRINT "*";
NEXT B
PRINT
NEXT A
END