首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >C# -我的do格式不能正确地输出到HTML文件中,我必须修复什么?

C# -我的do格式不能正确地输出到HTML文件中,我必须修复什么?
EN

Stack Overflow用户
提问于 2018-02-07 10:56:35
回答 1查看 48关注 0票数 0

我使用注释自动生成HTML文件的代码示例如下:

代码语言:javascript
复制
    ///<summary>Starting at 2, up until the square root of 'x' (any factor larger than that would be too large), output all factors.</summary>
    ///<param name="factors">The list of factors.</param>
    ///<param name="x">The number to get factors of.</param>
    ///<returns>Returns a filled list of factors of 'x'.</returns>
    static List<int> CalcGCD(List<int> factors, int x)
    {

        for (int i = 2; i <= Math.Sqrt(x); i++)
        {
            while (x % i == 0)
            {
                Console.Write(i + " ");
                x = x / i;
                factors.Add(i);
            }
        }

        if (x > 2)
        {
            factors.Add(x);
            Console.WriteLine(x);
        }

        return factors;
    }

这是它在HTML文件中输出的内容:

代码语言:javascript
复制
Starting at 2, up until the square root of 'x' (any factor larger than that would be too large), output all factors.

param name="factors">The list of factors.

param name="x">The number to get factors of.

returns>Returns a filled list of factors of 'x'.

summary>Get the common factors between a_factors and b_factors. Loops through both, and if the value is the same it removes it once from both and continues the process.

param name="common_factors">The list of common factors.

param name="a_factors">The list of factors for 'a'.

param name="b_factors">The list of factors for 'b'.

returns>Returns a list of common factors and outputs them.

Definition at line 18 of file Program.cs.

为什么XML还在那里?我怎么才能让它消失呢?

EN

回答 1

Stack Overflow用户

发布于 2018-02-07 17:42:17

我在使用粗体标签时也遇到过类似的问题。我的问题最终是因为开头的'<‘连接到了注释标记。

对我来说,这是可行的:

代码语言:javascript
复制
\\! <b>bold text `</b>`

这并不是:

代码语言:javascript
复制
\\!<b>bold text </b>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48655249

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档