Flow流程图
流程图各个框框代表的含义:
开始和结束
输入输出
判断和处理
模块关键字:
-
start
程序开始 -
end
程序结束 -
opreation
程序处理块 -
subroutine
子程序块 -
condition
条件判断 -
inputoutput
表示程序的输入输出 -
right 、left
表示箭头在当前模块的起点(默认向下,多默认和右) -
yes 、no
表示condition判断分支
模块用法:
模块标识=>模块关键字:内容
模块标识任意起名,最好知名解意,起一个标识的作用
内容就是框框里的文字
注意:模块关键字和内容之间有一个冒号,并且要在冒号后,必须要有一个空格
模块连接方法:
用->来连接,符号两侧不用空格
应用实例:
开始和结束模块
代码:
flowchat
st=>start: 开始
e=>end: 结束
st->e
开始和程序处理块(下)
代码
start=>start: 开始
operation=>operation: int i=1
start->operation
开始和程序处理块(右)
代码
start=>start: 开始
operation=>operation: int i=1
start(right)->operation
操作和判断
代码
con=>condition: for(int i=1;i<n;i++)
op1=>operation: int n=10;
op2=>operation: a++;
op3=>operation: a--;
op1->con
con(yes)->op2
con(no)->op3
完整流程1
st=>start: 开始
e=>end: 结束
op=>operation: 操作
sub=>subroutine: 子程序
cond=>condition: 判断
io=>inputoutput: 输出
st(right)->op->cond
cond(yes)->io(right)->e
cond(no)->sub(right)->op
完整流程2
st=>start: 开始
e=>end: 结束
op=>end: 操作
cond=>condition: 判断
st->op->cond
cond(yes)->e
cond(no)->op