이 알고리즘 명령이 실행되지 않습니다.

이 알고리즘 명령이 실행되지 않습니다.
\documentclass{article}
\usepackage{algpseudocode}
\usepackage{algorithm}
\begin{document}
\begin{algorithm}
\caption{family}
\hspace*{\algorithmicindent} \textbf{Input}\\
\hspace*{\algorithmicindent} \textbf{Output}
\begin{algorithmic}[1]
\State sing
\While dark
\State radar
\If {not found}
\State does
\ElsIf {pick}
\State case \If do
\State did
\EndIf
\EndWhile
\end{algorithmic}
\end{algorithm}
\end{document}

답변1

If 문 중 하나를 닫지 않았습니다. 이 코드는 작동합니다:

\documentclass{article} 
\usepackage{algpseudocode} 
\usepackage{algorithm} 

\begin{document} 
\begin{algorithm} 
\caption{family} 
\hspace*{\algorithmicindent} 

\textbf{Input}\ 
\hspace*{\algorithmicindent} 
\textbf{Output} 
\begin{algorithmic}[1] 
\State sing 
\While dark 
\State radar 
\If {not found} 
\State does 
\ElsIf {pick} 
\State case 
\If do 
\State 
did 
\EndIf 
\EndIf
\EndWhile 
\end{algorithmic} 
\end{algorithm}

\end{document}

또한, 참조하시기 바랍니다좋은 질문을 하는 방법은 무엇입니까?더 쉽게 읽을 수 있도록 코드 형식을 지정하세요. 내가 도울 수 있기를 바랍니다.

관련 정보