int s= 0; for(int sum=1; sum<=1000; ____ ){if(sum%7!=0){s = sum +s;}}System.out.println(s); A: sum+1 B: sum-1 C: sum++ D: sum--
int s= 0; for(int sum=1; sum<=1000; ____ ){if(sum%7!=0){s = sum +s;}}System.out.println(s); A: sum+1 B: sum-1 C: sum++ D: sum--
中国大学MOOC: 下列函数的时间复杂度是() int func(Int n){int i=0,sum=0;while(sum<n) sum+=++i;return i; }
中国大学MOOC: 下列函数的时间复杂度是() int func(Int n){int i=0,sum=0;while(sum<n) sum+=++i;return i; }
将函数\(f(x) = {e^x}\)展开成\(x\)的幂级数为( )。 A: \({e^x} = \sum\limits_{n = 0}^\infty { { { { x^n}} \over {n!}}} ( - \infty < x < + \infty )\) B: \({e^x} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n} { { {x^n}} \over {n!}}} ( - \infty < x < + \infty )\) C: \({e^x} = \sum\limits_{n = 0}^\infty { { { { x^n}} \over {n!}}} ( - 1 < x < 1)\) D: \({e^x} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n} { { {x^n}} \over {n!}}} ( - 1 < x < 1)\)
将函数\(f(x) = {e^x}\)展开成\(x\)的幂级数为( )。 A: \({e^x} = \sum\limits_{n = 0}^\infty { { { { x^n}} \over {n!}}} ( - \infty < x < + \infty )\) B: \({e^x} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n} { { {x^n}} \over {n!}}} ( - \infty < x < + \infty )\) C: \({e^x} = \sum\limits_{n = 0}^\infty { { { { x^n}} \over {n!}}} ( - 1 < x < 1)\) D: \({e^x} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n} { { {x^n}} \over {n!}}} ( - 1 < x < 1)\)
指出下列程序段的时间复杂度( )sum=1;for (i=0;sum<n;i++) sum+=1;。 A: O(0) B: O(1) C: O(n*n) D: O(n)
指出下列程序段的时间复杂度( )sum=1;for (i=0;sum<n;i++) sum+=1;。 A: O(0) B: O(1) C: O(n*n) D: O(n)
在下列程序段中,不能计算1到100之间奇数之和的是__________。 A: Dim sum As Integer sum = 0 For i = 1 To 100 Step 2 sum = sum + i Next B: Dim sum As Integer sum = 0 For i = 1 To 100 If i Mod 2 <> 0 Then sum = sum + i Next C: Dim sum As Integer sum = 0 For i = 1 To 99 sum = sum + i Next D: Dim sum As Integer sum = 0 For i = 100 To 1 Step -1 If i Mod 2 <> 0 Then sum = sum + i Next
在下列程序段中,不能计算1到100之间奇数之和的是__________。 A: Dim sum As Integer sum = 0 For i = 1 To 100 Step 2 sum = sum + i Next B: Dim sum As Integer sum = 0 For i = 1 To 100 If i Mod 2 <> 0 Then sum = sum + i Next C: Dim sum As Integer sum = 0 For i = 1 To 99 sum = sum + i Next D: Dim sum As Integer sum = 0 For i = 100 To 1 Step -1 If i Mod 2 <> 0 Then sum = sum + i Next
将\(f(x) = {1 \over {1 + {x^2}}}\)展开成\(x\)的幂级数为( )。 A: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n}{x^{2n}}} \matrix{ {} & {} \cr } ( - \infty < x < + \infty )\) B: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n}{x^{2n}}} \matrix{ {} & {} \cr } ( - 1< x < 1)\) C: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n}{x^{2n}}} \matrix{ {} & {} \cr } ( - 1 < x < 1)\) D: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { x^{2n}}} \matrix{ {} & {} \cr } ( - 1 < x < 1)\)
将\(f(x) = {1 \over {1 + {x^2}}}\)展开成\(x\)的幂级数为( )。 A: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n}{x^{2n}}} \matrix{ {} & {} \cr } ( - \infty < x < + \infty )\) B: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n}{x^{2n}}} \matrix{ {} & {} \cr } ( - 1< x < 1)\) C: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { {( - 1)}^n}{x^{2n}}} \matrix{ {} & {} \cr } ( - 1 < x < 1)\) D: \({1 \over {1 + {x^2}}} = \sum\limits_{n = 0}^\infty { { x^{2n}}} \matrix{ {} & {} \cr } ( - 1 < x < 1)\)
下面程序的运行结果是() inti = 0,sum=0; while(i++ < 5) sum += i; Console.WriteLine("{0},{1}",i,sum); A: 5,15 B: 6,15 C: 5,5 D: 6,6
下面程序的运行结果是() inti = 0,sum=0; while(i++ < 5) sum += i; Console.WriteLine("{0},{1}",i,sum); A: 5,15 B: 6,15 C: 5,5 D: 6,6
下列函数的时间复杂度是() int func(Int n){ int i=0,sum=0; while(sum<n) sum+=++i; return i; } A: O(logn) B: O(n^1/2) C: O(n) D: O(nlogn)
下列函数的时间复杂度是() int func(Int n){ int i=0,sum=0; while(sum<n) sum+=++i; return i; } A: O(logn) B: O(n^1/2) C: O(n) D: O(nlogn)
针对如下三个实现矩阵求和的不同函数:int a[N][N];int sumA( int a[N][N] ){ int i, j; int sum = 0; for ( i = 0; i < N; i++ ) for ( j = 0; j < N; j++ ) sum += a[i][j]; return sum;}int sumB( int a[N][N] ){ int i, j; int sum = 0; for ( j = 0; j < N; j++ ) for ( i = 0; i < N; i++ ) sum += a[i][j]; return sum;}int sumC( int a[N][N] ){ int i, j; int sum = 0; for ( j = 0; j < N; j+=2 ) for ( i = 0; i < N; i+=2 ) sum += ( a[i][j] + a[i+1][j] + a[i][j+1] + a[i+1][j+1] ); return sum;}当N足够大的时候,三个函数的运行时间t1、t2、t3符合下列哪种情况?()[/i][/i][/i][/i] A: t1 > t2 > t3 B: t3 > t1 > t2 C: t2 > t3 > t1 D: t3 > t2 > t1
针对如下三个实现矩阵求和的不同函数:int a[N][N];int sumA( int a[N][N] ){ int i, j; int sum = 0; for ( i = 0; i < N; i++ ) for ( j = 0; j < N; j++ ) sum += a[i][j]; return sum;}int sumB( int a[N][N] ){ int i, j; int sum = 0; for ( j = 0; j < N; j++ ) for ( i = 0; i < N; i++ ) sum += a[i][j]; return sum;}int sumC( int a[N][N] ){ int i, j; int sum = 0; for ( j = 0; j < N; j+=2 ) for ( i = 0; i < N; i+=2 ) sum += ( a[i][j] + a[i+1][j] + a[i][j+1] + a[i+1][j+1] ); return sum;}当N足够大的时候,三个函数的运行时间t1、t2、t3符合下列哪种情况?()[/i][/i][/i][/i] A: t1 > t2 > t3 B: t3 > t1 > t2 C: t2 > t3 > t1 D: t3 > t2 > t1
下面程序运行后的结果为___ Private Sub Form_Click() Dim i%, sum% i = 1 Do While i < 5 sum = sum + i * i i = i + 2 Loop Print sum End Sub A: 45 B: 35 C: 10 D: 25
下面程序运行后的结果为___ Private Sub Form_Click() Dim i%, sum% i = 1 Do While i < 5 sum = sum + i * i i = i + 2 Loop Print sum End Sub A: 45 B: 35 C: 10 D: 25