伪码如下
READ a number in decimal
INNITIALIZE powder = 0
REPEAT
- COMPUTE divide the number by two
- IF the left is divisible by two THEN sum MULTIPLY with 0’10 powder
- else sum MULTIPLY with 1’10 powder
- powder INCREMENT
- UNTIL num = 0
- CALCULATE the digit on each position of the final result by MULTIPLY digit and the corresponding 2’powder from right to left
- PRINT the result
C语言代码如下
1. Top-down design
In programming:Top-down is a programming style, the mainstay of traditional procedural languages, in which design begins by specifying complex pieces and then dividing them into successively smaller pieces.
2. Work breakdown structure (WBS)
A work breakdown structure (WBS), in project management and systems engineering, is a deliverable-oriented decomposition of a project into smaller components
3. 简述管理学 WBS 与 信息学Top-down设计 的异同:
同:
都是将大的目标分解为小的组成部分,化大为小,便于解决问题
异:
- Top-down design
目的在于将复杂的综合问题通过分析先分割成 能够实现的步骤,
目标和步骤之间没有严格的控制领导,
目标不为细节提供工作安排细节
是一个不断细化增添细节的过程 - Work breakdown structure
目的在于将目标分割为小的模块,以便达到每个模块的分工明确,再将各个同阶级模块,不断合作,来提高整体的工作效率
目标和步骤之间有严格的控制领导
目标可以为细节提供工作安排细节
是一个组装零件的过程