\documentclass{
ctexart}
\usepackage{
algorithm}
\usepackage{
algpseudocodex}
\makeatletter
\algnewcommand\algorithmicinit{
\textbf{
Init:}}
\algnewcommand\Init{
%
\algpx@endCodeCommand%
\ifnumcomp{
0}{
<}{
\FSSize{
algpx@startNewCodeBoxQueue}}{
\setbool{
algpx@setNorth}{
true}}{
}%
\algpx@drawInItem{
\algorithmicinit}%
}
\makeatother
\begin{
document}
\begin{
algorithm}
\caption{
title}
\begin{
algorithmic}[1]
\Require $x \in \{
0,1\}$
\Ensure $y \in \{
1,2\}$
\Init $y \in \{
1,2\}$
\end{
algorithmic}
\end{
algorithm}
\end{
document}
\usepackage{
algpseudocodex}
\makeatletter
\algnewcommand\algorithmicinit{
\textbf{
初始化:}}
\algnewcommand\Init{
%
\algpx@endCodeCommand%
\ifnumcomp{
0}{
<}{
\FSSize{
algpx@startNewCodeBoxQueue}}{
\setbool{
algpx@setNorth}{
true}}{
}%
\algpx@drawInItem{
\algorithmicinit}%
}
\makeatother
\def\gobbletwo#1#2{
}
\expandafter\gobbletwo