正在加载图片...
T4 分析:该题的意思说明一种具体的程序设计语言中规 定了一定的语法规则和基本的语句(指令),那么利 用这种语言编写程序,必须符合该语言的语法规则 并且只能使用它的基本指令集。 (a)2 x-a a m- a X- a L2 m c- a if m>0 then goto L2 x- a L1:b=b-1 ifb>0 then goto LI X-X L2:x=x+1 b=b-1 C-C L4:d=d-1 ifb>0 then goto L if c>0 then goto L2 L3 halt ifb>0 then goto LI n=n-1 ifn >0 then goto L3 halt ifd>0 then goto L- halt⚫ T4 ⚫ 分析:该题的意思说明一种具体的程序设计语言中规 定了一定的语法规则和基本的语句(指令),那么利 用这种语言编写程序,必须符合该语言的语法规则, 并且只能使用它的基本指令集。 (a).1 x = a L: x = x - 1 b = b - 1 if b > 0 then goto L halt (a).2 x = a c = a L1: b = b - 1 L2: x = x +1 c = c –1 if c > 0 then goto L2 if b > 0 then goto L1 halt (a).3 x = a m = a L1: b = b - 1 L2: x = x +1 m = m –1 if m> 0 then goto L2 if b > 0 then goto L1 y = c n = c L4: d = d - 1 L3: y = y +1 n = n - 1 if n > 0 then goto L3 if d > 0 then goto L4 halt
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有