我执行了这个代码,但是算法的输出并不像上图这样
\usepackage[options ]{algorithm2e}
\begin{algorithm}
\SetAlgoLined
\SetKwInOut{Step}{Step}
\SetKwInOut{Input}{Input}\SetKwInOut{Output}{Output}
\Input{The }
\Output{The }
\For{Num}{
\Step{Choose}
\Step{Choose}
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{To }
\end{algorithm}
答案1
\documentclass{article}
\usepackage[ruled]{algorithm2e}
\begin{document}
\begin{algorithm}
\SetAlgoLined
\caption{To}
\SetKwInOut{Step}{Step}
\SetKwInOut{Input}{Input}\SetKwInOut{Output}{Output}
\Input{The}
\Output{The}
\For{Num}{
\par\textbf{Step 1:} Choose
\par\textbf{Step 2:} Choose
\par\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\end{algorithm}
\end{document}