我已经编写了代码,但是行号不正确,代码如下所示:
\begin{algorithm}[H]
\caption{Algorithm}
\begin{algorithmic}[1]
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\REQUIRE $Graph\ G(V, E)$
\STATE $\textbf{\textit{function}}\ $
\Do
\State Something
\doWhile
\end{algorithmic}
\label{algo1}
\end{algorithm}
上述代码的输出如下所示:
我怎样才能得到正确的编号?或者有没有更简单的方法在乳胶中编写 do while 循环?