考虑下面的属性文法G(S):产 生 式语 义 规 则S ® ABCprint A.num, B.num, C.num A ® [img=20x22]1803d73211b24cd.png[/img] aA.num = [img=20x22]1803d73211b24cd.png[/img].num + 1A ® εA.num = 0B ®[img=20x22]1803d7322247642.png[/img]bB.num = [img=20x22]1803d7322247642.png[/img].num + 1B ® εB.num = 0C ®[img=20x22]1803d7323424a77.png[/img] cC.num = [img=20x22]1803d7323424a77.png[/img].num + 1C ® εC.num = 0对于输入字符串aabbbc进行语法分析和属性计算,输出结果是
A: 1 2 3
B: 3 2 1
C: 2 3 1
D: 2 1 3
A: 1 2 3
B: 3 2 1
C: 2 3 1
D: 2 1 3
举一反三
- 考虑下面的属性文法G(S):产 生 式语 义 规 则S ® ABC print A.num, B.num, C.num A ® [img=20x22]18035825cebcda4.png[/img] aA.num = [img=20x22]18035825cebcda4.png[/img].num + 1A ® εA.num = 0B ® [img=20x22]18035825e1973dc.png[/img] bB.num = [img=20x22]18035825e1973dc.png[/img].num + 1B ® εB.num = 0C ® [img=20x22]18035825f2dc704.png[/img] cC.num = [img=20x22]18035825f2dc704.png[/img].num + 1C ® εC.num = 0对于输入字符串aabbbc进行语法分析和属性计算,输出结果是 A: 1 2 3 B: 3 2 1 C: 2 3 1 D: 2 1 3
- 考虑下面的属性文法G(S):产 生 式语 义 规 则S ® ABC print A.num, B.num, C.num A ® [img=20x22]1803d731db39d57.png[/img] aA.num = [img=20x22]1803d731db39d57.png[/img].num + 1A ® εA.num = 0B ® [img=20x22]1803d731ec91e62.png[/img] bB.num = [img=20x22]1803d731ec91e62.png[/img].num + 1B ® εB.num = 0C ® [img=20x22]1803d731fcad3f0.png[/img] cC.num = [img=20x22]1803d731fcad3f0.png[/img].num + 1C ® εC.num = 0对于输入字符串aabbbc进行语法分析和属性计算,输出结果是 A: 1 2 3 B: 3 2 1 C: 2 3 1 D: 2 1 3
- 下列程序的输出结果是() num = 27 count = 0 while num > 0: if num % 2 == 0: num /=2 elif num % 3 ==0: num /= 3 else: num -=1 count += 1 print (count)
- 编写一个函数判断客户输入一个数字为1位、2位还是更多为,代码如下:请补全空下的代码num=int(input("输入一位或两位的数字:"))n='0'(1)n='1'(2)n='2'(3)d='>;2'print(n+"位数。”) A: 1: if num>;-10 and num<;10:2: eilf num >;-100 and num<;100:3: else: B: 1: if num>;10 and num<;-10:2: eilf num >;-100 and num<;100:3: else: C: 1: if num>;-10 and num<;10:2: eilf num <;-100 and num>;100:3: elif: D: 1: if num>;-100 and num<;100:2: eilf num >;-10 and num<;10:3: else:
- 阅读如下程序段,则执行后程序的输出结果是()。main(){structa{intx;inty;}num[2]={{20,5},{6,7}};printf("%d\n",num[0].x/num[0].y*num[1].y);}? 0|20|28|5