用QBASIC语言编程图形.求公式详解.求高手详解,谢谢了.
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/08 22:36:09
用QBASIC语言编程图形.求公式详解.求高手详解,谢谢了.
*
**
***
****
for a 1 to 4
for b 1 to 4
print “*”;
if b = a then exit for
next
print
next
*
**
***
****
for a 1 to 4
for b 1 to 4
print “*”;
if b = a then exit for
next
next
你的答案有错误,我帮你改了.
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
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
NEXT A
END