算法

  1. 算法头文件
\usepackage{algorithmic}
\usepackage{algorithm}
  1. 算法模板
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{algorithm}
\caption{Algorithm Name}
\begin{algorithmic}
\REQUIRE $input$: input data.
\ENSURE $ouput$: output data.

\STATE $b \leftarrow a$.
\FOR { $a \in b$}
\IF {$b == 0$}
\STATE $b \leftarrow 0$.
\ENDIF
\ENDFOR

\end{algorithmic}
\label{Algorithm_Label}
\end{algorithm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

你可能感兴趣的:(算法)