随笔分类 - ProblemSolving
摘要:/* 输入一个正数x和一个正整数n,求下列算式的值。 x - x2/2! + x3/3! + ... + (-1)n-1xn/n! 要求定义两个调用函数:fact(n)计算n的阶乘 mypow(x,n)计算x的n次幂(即x^n),两个函数的返回值类型是double。(×输出保留4位小数) 计算分析:
阅读全文
摘要:/* Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3
阅读全文