如果N=2,Sum(N)是一个函数,且Sum(1)=5,那么语句:Set Sum=Sum(N-1) +N将把值6赋给Sum。
举一反三
- 如果N=2,Sum(N)是一个函数,且Sum(1)=5,那么语句:Set Sum=Sum(N-1) +N将把值6赋给Sum。If N = 2, Sum (N) is a function and Sum (1) = 5, then the statement:Set Sum = Sum (N-1) +NThe value 6 will be assigned to Sum.
- 输入一个正整数给变量n,求1到n的所有正整数之和。不正确的程序是()。 A: #includevoidmain(){inti,n,sum;scanf("%d",&n);for(i=1,sum=0;i<=n;i++)sum=sum+i;printf("%d",sum);} B: #includevoidmain(){inti,n,sum=0;scanf("%d",&n);for(i=1;i<=n;i++)sum=sum+i;printf("%d",sum);} C: #includevoidmain(){inti,n,sum;scanf("%d",&n);for(i=1;i<=n;i++)sum=sum+i;printf("%d",sum);} D: #includevoidmain(){inti,n,sum;scanf("%d",&n);for(i=1,sum=0;i<=n;)sum=sum+i,i++;printf("%d",sum);}
- 下列级数中,收敛的是( ). A: \(<br/>\sum\limits_{n = 1}^\infty { { 1 \over n}} \) B: \(<br/>\sum\limits_{n = 1}^\infty { { 1 \over { { n^2}}}} \) C: \(<br/>\sum\limits_{n = 1}^\infty { { 1 \over {\sqrt n }}} \) D: \( \sum\limits_{n = 1}^\infty { { 1 \over {\root 3 \of { { n^2}} }}} \)
- 下面的函数功能是求s=1+3+5+......+(2*n-1),请填充完整。 int s(int n) { int sum; if( (1) ) sum=1; else sum= (2) ; return (3) ; }
- 设级数$\sum\limits_{n=1}^\infty u_n$ 收敛,则下列级数收敛的是() A: $\sum\limits_{n=1}^\infty \left(u_n+1\right)$ B: $\sum\limits_{n=1}^\infty u_{2n}$ C: $\sum\limits_{n=1}^\infty u_{n+1}$ D: $\sum\limits_{n=1}^\infty u_{2n+1}$