【单选题】【消耗次数:1】
在for语句中,假定循环体共被执行n次,则表达式3共被计算( )次。
1
n-1
n
n+1
参考答案:
复制
纠错
相关题目
【单选题】 在for语句中,假定循环体共被执行n次,则表达式2共被计算( )次。
①  1
②  n-1
③  n
④  n+1
【单选题】 在for语句中,假定循环体共被执行n次,则共被计算( )次。
①  1
②  n-1
③  n
④  n+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
【单选题】 设有定义:intn1=0,n2,*p=&n2,*q=&n1;,以下赋值语句中与n2=n1;语句等价的是()
①  *p=*q;
②  p=q;
③  *p=n1
④  p=*q;
【单选题】 在下面循环语句中内层循环体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
【单选题】 循环语句“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
【单选题】 以下程序中的循环执行了()次。#defineN2#defineMN+1#defineNUM(M+1)*M/2main(){inti,n=0;for(i=0;ii++)n++;printf("%d\n",n);}
①  5
②  6
③  8
④  9
【单选题】 循环体至少被执行一次的语句为()
①  for循环
②  while循环
③  do循环
④  任一种循环
随机题目
【单选题】 Which of the following is the time when students work as a whole class?
①  When all the students are under the control of the teacher
②  When students work in pairs on an exercise or a task
③  When students work in small groups
④  When students are expected to work on their own at their own speed.
【单选题】 What role does a teacher play in the following activity? While doing a writing task either individually or in groups, the students need to use a particular word they don’t know. So they ask the teacher.
①  Controller
②  Assessor
③  participant
④  Resource-provider.
【单选题】 What role does a teacher play in the following activity? The teacher asks a student a question “Have you ever bought clothes with problems?” If the student doesn’t seem to be ready, the teacher says “for example, a shirt without...” and points to the buttons on his own shirt or jacket.
①  Controller
②  Assessor
③  Organizer
④  Prompter.
【单选题】 What role does a teacher play in the following activity? T: do you have any hobbies? S: yes, I like singing and dancing. T: Uhm, and...? S: I also collect coins. T: Oh, really, how many...have you already...collected?
①  Controller
②  Assessor
③  Organizer
④  Prompter
【单选题】 Which of the following is the advantage of whole class work?
①  It is an ideal way to show materials and do presentations together
②  It allows students to work together rather than under teacher’s guidance.
③  There is always a great chance of different opinions and contributions to the work
④  It is less stressful.
【单选题】 Which of the following is the time when students work in groups?
①  When all the students are under the control of the teacher
②  When students work in pairs on an exercise or a task
③  When students work in small group
④  When students are expected to work on their own at their own speed.
【单选题】 What role does a teacher play in the following activity? The teacher gives students 2 minutes to skim a text, and when time is up, he asks students to stop and answer some questions.
①  Controller
②  Assessor
③  Organizer
④  Prompter
【单选题】 What are the possible roles of a teacher?
①  Controller, assessor
②  Organizer, prompter
③  Participant, resource-provider
④  All of the above.
【单选题】 Which of the following is the time when students study by themselves?
①  When all the students are under the control of the teacher
②  When students work in pairs on an exercise or a task
③  When students work in small groups
④  When students are expected to work on their own at their own speed.
【单选题】 What role does a teacher play in the following activity? When a student has made a sentence with borrow, “I borrowed a paper to write a letter”, the teacher says, “Well, we don’t say a paper, we say a piece of paper.”
①  Controller
②  Assessor
③  Organizer
④  Prompter.