小编Jon*_*hai的帖子

如何将变量从一个批处理文件传递到另一个批处理文件?

如何编写获取输入变量并将其发送到另一个批处理文件以进行处理的批处理文件.

批次1

我不知道如何将变量发送到批处理2,这是我的问题.

批次2

if %variable%==1 goto Example
goto :EOF

:Example
echo YaY
Run Code Online (Sandbox Code Playgroud)

batch-file

11
推荐指数
2
解决办法
3万
查看次数

当输入高于 12 时阶乘计算失败

我的代码对数字进行阶乘,但由于某种原因,每当我输入 13 或更高的数字时,它要么给出错误的数字,要么以某种方式得到负数。有什么建议么?

        List<int> myList = new List<int>();
        Console.WriteLine("My Job is to take the factorial of the number you give");
        Console.WriteLine("What is the number?");
        string A = Console.ReadLine();
        int C = Convert.ToInt32(A);
        int k = C;
        int B = C;
        int U = C - 1;
        Console.Write("{0} ", B);
        while (U != 0)
        {
           k *= U;
           Console.Write("* {0} ", U);
            U--;
        }
        Console.WriteLine(" = {0}", k);
        Console.ReadLine();
Run Code Online (Sandbox Code Playgroud)

c# factorial

0
推荐指数
1
解决办法
2573
查看次数

标签 统计

batch-file ×1

c# ×1

factorial ×1