㈠ 计算数的阶乘,分别用while语句、do-while语句和for语句实现
//用for
        int n;
        int result=1;
        //在这里输入要计算阶乘的数n
        for (int i = 1; i <= n; i++)
        {
            result *= i;
        }
        //在这里输出结果result
        //用while
        int n;
        int result = 1;
        //在这里输入要计算阶乘的数n
        while (n>0)
        {
            result *= n--;
        }
        //在这里输出结果result
        //用do while
        int n;
        int result = 1;
        //在这里输入要计算阶乘的数n
        do
        {
            result *= n--;
        } while (n > 0);
        if (result < 1) {
            result = 1;
        }
        //在这里输出结果result