案例1
\documentclass{article}
\usepackage{xeCJK}
\usepackage[]{algorithm2e}
%\usepackage{ctex} % 中文包
\begin{document}
\renewcommand{\algorithmcfname}{算法} % 把标题设置为“算法”
\begin{algorithm}
\SetKwInOut{Input}{输入}
\SetKwInOut{Output}{输出}
\Input{Some input data\;these inputs can be displayed on several lines and one input can be wider than line's width.}
\Output{Same for output data}
\caption{How to write algorithms}
\end{algorithm}
\end{document}
结果如下