Latex中文算法代码

Latex中文算法代码 导言区\usepackage{algorithm} \usepackage[linesnumbered, ruled, lined,boxed,commentsnumbered]{algorithm2e}[1] \floatname{algorithm}{算法} \SetKwInOut{KwIn}{输入} \SetKwInOut{KwOut}{输出}代码\begin{algorithm}[H] \SetAlgoLined %显示end \caption{algorithm caption}%算法名字 \KwIn{input parameters A, B, C}%输入参数 \KwOut{output result}%输出 some description\; %\;用于换行 \For{condition}{ only if\; \If{condition}{ 1\; } } \While{not at end of this document}{ if and else\; \eIf{condition}{ 1\; }{ 2\; } } \ForEach{condition}{ \If{condition}{ 1\; } } return \end{algorithm}