早教吧 育儿知识 作业答案 考试题库 百科 知识分享

请教一个ABAP编写九九乘法表的问题datas(2)typecvalue0.datad(2)typecvalue0.dataz(2)typecvalue0.do9times.s=s+1.y=y+1.z=s*y.writez.enddo.

题目详情
请教一个ABAP编写九九乘法表的问题
data s(2) type c value 0.
data d(2) type c value 0.
data z(2) type c value 0.
do 9 times.
s=s+1.
y=y+1.
z=s*y.
write z.
enddo.
▼优质解答
答案和解析
DATA:LEFT(2) TYPE N VALUE 1,
RIGHT(2) TYPE N VALUE 1,
COUNTER TYPE I VALUE 1,
RESULT(2) TYPE N .
DO 9 TIMES.
DO COUNTER TIMES.
RESULT = LEFT * RIGHT.
WRITE:LEFT,'*',RIGHT,'=',RESULT,' '.
RIGHT = RIGHT + 1.
ENDDO.
RIGHT = 1.
COUNTER = COUNTER + 1.
WRITE:/.
LEFT = LEFT + 1.
ENDDO.