【单选题】【消耗次数:1】
在下面循环语句中内层循环体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; 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
随机题目
【单选题】 — David injured his leg playing football yesterday.— Really? ______?
①  Who did that
②  Whats wrong with him
③  How did that happen
④  Why was that
【单选题】 I wont be free ________ I finish this work.
①  :after
②  :until
③  :but
④  :when
【单选题】 --Do you dance? --Yes, I do.--________?--Every weekend.
①  :How hard do you practice
②  :How much do you pay for it
③  :How often do you go dancing
④  :How long do you practice it
【单选题】 --I went to the beach and got plenty of rest. --_______. You looked tired last time I saw you.
①  :I hope so
②  :Really
③  :Im glad you did
④  :The sound was nice
【单选题】 Some famous singers live on the _______from their record sales.
①  :salary
②  :price
③  :bill
④  :income
【单选题】 -- Whos speaking?-- This is Tom_____________.
①  :speaks
②  :spoken
③  :speaking
④  :saying
【单选题】 -- Wow! This is a marvelous room! Ive never known youre so artistic.--______
①  Great, I am very art-conscious.
②  Dont mention it.
③  Thanks for your compliments.
④  Its fine.
【单选题】 — Oh, Im sorry. But I promise Ill be more careful next time.— _______________________.
①  Its nothing
②  Oh, never mind. It doesnt matter
③  Thank you
④  There are no questions
【单选题】 -_________ Well, they got there last Wednesday. So about a week.
①  When did your parents arrive in Paris?
②  How long have your parents been in Paris?
③  Did your parents arrive in Paris last Wednesday?
④  When will your parents go to Paris?
【多选题】 洋务运动的代表人物有( )。
①  曾国藩
②  李鸿章
③  左宗棠
④  张之洞