【单选题】【消耗次数:1】
下面的方法,当输入为2的时候返回值是多少?( ) public int getValue(int i) { int result = 0; switch (i) { case 1: result = result + i; case 2: result = result + i * 2; case 3: result = result + i * 3; } return result; }
0
2
4
10
参考答案:
复制
纠错
相关题目
【单选题】 有以下程序,程序运行以后的输出结果是() #include stdio.h main( ) { int a[ ]={2,3,5,4},i; for(i=0;i switch(i%2) { case 0:switch(a[i]%2) {case 0:a[i]++;break; case 1:a[i]--; }break; case 1:a[i]=0; } for(i=0;i printf(\n); }
①  3 3 4 4
②  2 0 5 0
③  3 0 4 0
④  0 3 0 4
【多选题】 如果输入的是5,以下程序运行结果不正确的是() #include #define M n+n void main( ) { int n; int result; printf(请输入一个整数:); scanf(%d, result=M*M; printf(result = %d\n,result); }
①  100
②  35
③  25
④  50
【单选题】 The result is entirely() .
①  unpredictable
②  predictably
③  predict
④  prediction
【单选题】 以下程序段运行后s的值是()。 int a[3][3]={1, 2, 3, 4, 5, 1, 2, 3, 4} ; int i, j, s=1; for(i=0; i for(j=i+1; j s+=a[i][j];
①  6
②  120
③  7
④  240
【单选题】 The building suffered ____ damage as a result of the big fire.
①  moderate
②  considerable
③  considerate
④  concrete
【单选题】 As a result of the unfavorable working conditions, the project has to be put off ____ .
①  temporarily
②  tremendously
③  traditionally
④  typically
【单选题】 As a result of careless washing the jacket _____ to a child’s size.
①  compressed
②  shrank
③  dropped
④  decreased
【单选题】 下面程序执行后的结果是() #include stdio.h void fun( ) { int i,sum=0; int a[5]={1,2,3,4,5}; for (i=0;i { if (a[i]%2==0) { sum+=a[i]; } } printf(%d,sum); } void main( ) { fun( ); }
①  6
②  15
③  9
④  11
【单选题】 以下程序的输出结果是_______? f(int b[],int m,int n) { int i,s=0; for(i=m;in;i=i+2) s=s+b[i]; return s; } int main() { int x,a[]={1,2,3,4,5,6,7,8,9}; x=f(a,3,7); printf(%d\n,x); }
①  7
②  8
③  9
④  10
【单选题】 As a result of the unfavorable working conditions, the project has to be put off____.
①  temporarily
②  tremendously
③  traditionally
④  typically
随机题目
【判断题】 总时差为最小的工作应为关键工作。
①  正确
②  错误
【判断题】 流水节拍是指两个相邻的工作队相继进入同一施工段流水作业的时间间隔。
①  正确
②  错误
【判断题】 流水施工的参数主要是工艺参数、空间参数和时间参数。
①  正确
②  错误
【单选题】 在单代号搭接网络计划中,( )表示工作之间有搭接关系的逻辑关系。
①  节点
②  编号
③  线路
④  箭线
【单选题】 在网络计划中,若某项工作的( )最小,则该工作必为关键工作。
①  自由时差
②  持续时间
③  时间间隔
④  总时差
【判断题】 双代号网络计划是用双代号表示法绘制的网络计划,网络图中的箭线及其两端节点的编号表示工作。
①  正确
②  错误
【判断题】 网络计划工作时间参数有六个,为工作最早开始时间、工作最早完成时间、工作最迟开始时间、工作最迟完成时间、工作总时差和工作自由时差。
①  正确
②  错误
【判断题】 无节奏流水,亦称成倍节拍流水,各个施工过程的流水节拍之间存在整数倍关系。
①  正确
②  错误
【判断题】 双代号时标网络计划。以时间坐标为尺度绘制的双代号网络计划。
①  正确
②  错误
【判断题】 网络图中允许出现循环线路。
①  正确
②  错误