论文部分内容阅读
第六讲分支程序许多实际问题并不象我们前面讲的那样简单,它们往往都要根据给定的条件,由计算机进行自动判别,按判别后的不同情况转到程序中不同语句去进行不同的处理,使程序分成两支、三支……多支。例7:某市工程设计预算规定,土方工程量计算规则为:挖土深度在1.2米以内不用放坡,超过1.2米者,需增加放坡土方量30%,试编制该计算工程量的程序。本例工程量计算公式可写成: L×B×H (H≤1.2米时) 挖土体积V=L×B×H×1.3 (H>1.2米时) 为了解决这类比较复杂的问题,需要先确定一
Chapter VI Many practical problems of branch programs are not as simple as the ones we mentioned earlier. They often have to be automatically determined by the computer according to the given conditions. Different conditions are used to go to different statements in the program for different purposes. Processing, the program is divided into two, three ... ... more than one. Example 7: A city’s engineering design budget stipulates that the earthwork volume calculation rule is: if the excavation depth is within 1.2 meters without grading, if it exceeds 1.2 meters, the amount of grading earthwork required is increased by 30%. . The calculation formula for this project quantity can be written as: L×B×H (H≤1.2m) Digging volume V=L×B×H×1.3 (H>1.2m) To solve this kind of complicated problem, it is necessary to First determine one