一条指令时,两种走法一样快
运行下面这段程序,填写它打印出来的结果。
STAGES = 5
def one_by_one(n):
return n * STAGES
def pipelined(n):
return n + STAGES - 1
print(str(one_by_one(1)) + "/" + str(pipelined(1)) + "/"
+ str(round(one_by_one(1) / pipelined(1), 2)))
运行下面这段程序,填写它打印出来的结果。
STAGES = 5
def one_by_one(n):
return n * STAGES
def pipelined(n):
return n + STAGES - 1
print(str(one_by_one(1)) + "/" + str(pipelined(1)) + "/"
+ str(round(one_by_one(1) / pipelined(1), 2)))
全部评论