控制流图用plantuml语言表示
时间: 2023-11-27 16:12:02 浏览: 101
PlantUML绘图_uml_PlantUML绘图_
以下是用 PlantUML 语言表示的控制流图代码:
```
@startuml
start
if (nPosX <= 0) then (yes)
stop
else (no)
repeat
:nSum = nPosX + nPosY;
if (nSum > 1) then (yes)
:nPosX--;
:nPosY--;
else (no)
if (nSum < -1) then (yes)
:nPosX -= 2;
else (no)
:nPosX -= 4;
endif
endif
repeat while (nPosX > 0)
stop
@enduml
```
生成的控制流图如下:
![控制流图](https://i.imgur.com/CxK9N9A.png)
阅读全文