1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <iostream> #include <cstdio> using namespace std; const int n=10; int s1; int co(int i1){ int j1,s1; s1=n; for (int j1 =n-1; j1 >=n-i1+1; --j1) s1=(s1*j1)/(n-j1+1); return s1; } int main(){ s=n+1; for (int i = 2; i <=n; ++i)s=s+co(i); printf("s=%d",s); } |
0 of 4 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
1、将17行i=2改为i=1,程序运行结果不会发生变化。
2、将08行的”j1″去掉,程序运行结果不会发生变化。
3、该程序的时间复杂度为( )
4、程序输出为:( )