【单选题】【消耗次数:1】
在下面循环语句中内层循环体S语句的执行总次数为()。 for(int i=0; i i++) for(int j=i; j j++) S;
n2
(n+1)/2
n(n-1)/2
n(n+1)/2
参考答案:
复制
纠错
相关题目
【单选题】 在下面循环语句中内层循环体S语句的执行总次数为( ) for(int i=0; i<n; i++) for(int j=i; j<n; j++) S;
①  n2
②  (n+1)/2
③  n(n-1)/2
④  n(n+1)/2
【单选题】 在下面循环语句中内层循环体S语句的执行总次数为()。 for(int i=0; i<n; i++) for(int j=i; j<n; j++) S;
①  n2
②  (n+1)/2
③  n(n-1)/2
④  n(n+1)/2
【单选题】 在下面循环语句中内层循环体S语句的执行次数为( )。 for(int i=0;i<n;i++) for(int j=i;j<n;j++)S;
①  n2
②  (n+1)/2
③  n(n-1)/2
④  n(n+1)/2
【单选题】 在下面循环语句中内层循环体S语句的执行总次数为( ) for(int i=0; i i++) for(int j=i; j j++) S;
①  n2
②  (n+1)/2
③  n(n-1)/2
④  n(n+1)/2
【单选题】 在下面循环语句中内层循环体S语句的执行次数为( )。 for(int i=0;ii++) for(int j=i;jj++)S;
①  n2
②  (n+1)/2
③  n(n-1)/2
④  n(n+1)/2
【单选题】 循环语句“for(int i=0; i<n; i++) cout<<i*i<<’ ’;”中循环体执行的次数为()。
①  1
②  n-1
③  n
④  n+1
【单选题】 循环语句“for(int i=0; i<n; i++) cout<<i*i<<’ ’;”中循环体执行的次数为(????)
①  1
②  n-1
③  n
④  n+1
【单选题】 设语句x++的时间是单位时间,则以下语句的时间复杂度为( )。 for(i=1; i<=n; i++) for(j=i; j<=n; j++) x++;
①  O(1)
②  O(n的平方)
③  O(n)
④  O(n的立方)
【单选题】 在下面循环语句中循环体执行的次数为() for(int i=0; in/2) break;
①  n/2
②  n/2+1
③  n/2-1
④  n-1
【单选题】 在下面循环语句中循环体执行的次数为()。 for(int i=0; in/2) break;
①  n/2
②  n/2+1
③  n/2-1
④  n-1
随机题目
【单选题】 In the wife’s eyes, his _____ to their marriage life is far from perfect.
①  requirement
②  commitment
③  participation
④  reflection
【单选题】 I think the private ownership of guns is a _______mistake.
①  wonderful
②  great
③  tragic
④  romantic
【单选题】 America has a lot of _______ weapons now.
①  aggressive
②  expensive
③  passive
④  expressive
【单选题】 My grandfather had suffered from cancer for two years. It was no surprise when I was told that he had _____.
①  passed off
②  passed away
③  passed by
④  passed over
【单选题】 Not only ______ our money, but we were also in danger of losing our lives.
①  we lost
②  lost we
③  we did lose
④  did we lose
【单选题】 We are going to have a singing party tonight. Would you like to join us?___________
①  I’m afraid not, because I have to go to an important meeting.
②  Of course not. I have no idea.
③  No, I can’t.
④  That’s all set.
【单选题】 Use daily writing to ______ your communication skills.
①  track
②  discharge
③  contract
④  enhance
【单选题】 The dean of the Philosophy Department requested that the visiting scholar ______ a lecture on the philosopher Sartre.
①  gave
②  give
③  would give
④  had given
【单选题】 It became harder for women married to diplomats(外交家) to _______ their own interests.
①  pursue
②  replace
③  absorb
④  convince
【单选题】 As a result of his hard work, he has gained ______ to the Beijing University.
①  access
②  commitment
③  opportunity
④  reward