怎么用algorithm环境插入伪代码来表示算法呢?
Opened this issue · 1 comments
talenz commented
下面这样编译过不了呢?有什么办法可以插算法环境吗?
\usepackage{algorithm}
\usepackage{algorithmic}
\begin{document}
\begin{algorithm}
\caption{Calculate
\label{alg1}
\begin{algorithmic}
\REQUIRE
\ENSURE
\STATE
\IF{$n < 0$}
\STATE
\STATE
\ELSE
\STATE
\STATE
\ENDIF
\WHILE{$N \neq 0$}
\IF{$N$ is even}
\STATE
\STATE
\ELSE[$N$ is odd]
\STATE
\STATE
\ENDIF
\ENDWHILE
\end{algorithmic}
\end{algorithm}
garylavayou commented
\usepackage{algorithm,algorithmic}
没有问题,可以正常编译, @talenz 。