需要注意的是下面的代码采用是\usepackage{algorithmic}
而不是\usepackage{algorithm2e}

Latex algorithmic 中添加 comment

对应的代码如下:

\STATE $sum=0$;
\FOR[comment for FOR]{$j=1$ \TO $100$}
	\IF[comment for IF]{$j\%2==1$}
		\STATE $sum=sum+i$; \COMMENT{normal comment}
	\ENDIF
\ENDFOR

相关文章:

  • 2021-09-09
  • 2022-01-18
  • 2021-10-12
  • 2021-11-21
  • 2022-01-15
  • 2021-11-14
  • 2021-10-11
  • 2021-12-07
猜你喜欢
  • 2021-12-08
  • 2022-12-23
  • 2021-10-06
  • 2021-10-26
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
相关资源
相似解决方案