作业帮 > 综合 > 作业

英语翻译In a computer program,separate loops with distinct indic

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/29 18:31:53
英语翻译
In a computer program,separate loops with distinct indices produce M and N
operations,respectively.If these reside internally in a loop with an independent index
producing P operations,find the total number of operations represented by the three loops.
问题:
在一个计算机程序中,两个各自有独立指数的回圈分别产生 M 个和 N 个运算.若这些回圈都是位於另一个有独立指数,并会产生 P 个运算的回圈之内,请找出这三个回圈合共所代表的运算总数.
我的建议答案:
外回圈每运算一次,在它里面的两个回圈便会分别产生 M 个和 N 个运算,亦即会产生 (M + N) 个运算.所以,当外回圈运算 P 次之後,两个内回圈便会合共产生 P * (M + N) 个运算.再加上外回圈自己的 P 个运算,三个回圈合共代表的运算总数便等於:
P * (M + N) + P = P * (M + N + 1)
所以答案应该是:P * (M + N + 1)