四条指令,两种走法
运行下面这段程序,填写它打印出来的结果。
STAGES = 5
FLUSH = 3
def pipelined(n):
return n + STAGES - 1
def wrong_guesses(pattern):
last = -1
wrong = 0
for t in pattern:
if last == -1 or t != last:
wrong = wrong + 1
last = t
return wrong
n = 4
print(str(n * STAGES) + "/" + str(pipelined(n)) + "/"
+ str(round(n * STAGES / pipelined(n), 2)))
全部评论