<pre> not working well with <iostream> for C++ Code</iostream></pre>

时间:2015-01-04 14:49:56

标签: html include pre

我想显示下面的文字

#include <algorithm>
#include <iostream>

在我的HTML文件中。我知道我们必须使用HTML pre标记,但是当我这样做时,我只能看到#include

实际上,我无法在Stack Overflow上包含代码;它只显示#include

请帮帮我。

1 个答案:

答案 0 :(得分:2)

您必须将<>(HTML保留字符)替换为各自的HTML实体:&lt;&gt;

<pre>
  #include &lt;algorithm&gt;
  #include &lt;iostream&gt;
</pre>