如何理解下面这句话? My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed.For that reason we should do our utmost to shorten the conceptual gap between the static program_and the dynamic process,to make the correspondence between the program (spread out in text space)and the process (spread out in time)as trivial as possible. https://enwikipedia.org/wiki/Edsger_WDijkstra ----E.W.Dijkstra
如何理解下面这句话? • My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed. For that reason we should do our utmost to shorten the conceptual gap between the static program and the dynamic process, to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible. ----E.W.Dijkstra https://en.wikipedia.org/wiki/Edsger_W._Dijkstra
问题2: 但是我们并不只吃一只, 怎么办?
问题2: 但是我们并不只吃一只, 怎么办?
策略一:控制数量 注意: 这个过程的“结构”与计 假如规定吃X只 开始 数器的初始值没有关系」 Bound iteration 设一个计数器,并 将其值设定为0。 吃一只汤包 计数器值加1,并 否 判断其是否为X 是 结束
Bound iteration 假如规定吃X只 X
策略二:吃饱为止 开始 Unbound iteration 是 是否已饱? 结束 吃一只汤包 如果即使饱了,也希望再品尝一个,该怎么办? 问题:你能正确选择采用何种策略设计循环吗?
如果即使饱了,也希望再品尝一个,该怎么办? Unbound iteration 问题:你能正确选择采用何种策略设计循环吗?
有人知道饱不饱,但有人不知道 问题: 开始 如果要判断的情况不只有 两种,该怎么办? 否 要吃汤包的 是 人不到5岁吗? if(c1){ switch(X){ case 1:...break; }else if(c2){ 选用策略2 选用策略1 case 2:...break; default:... else if... 结束 elset }
有人知道饱不饱,但有人不知道 if(c1){ … }else if(c2){ … } else if… … }else{ … } switch( X){ case 1:…break; case 2:…break; default:… } 问题: 如果要判断的情况不只有 两种,该怎么办?