【单选题】【消耗次数:1】
运行以下程序,从键盘上输入china# #includevoid main() { int v1=0,v2=0; char ch; while((ch=getchar())!=#) switch(ch) { case a: case h: default: v1++; case 0:v2++; } printf(%d,%d\n,v1,v2); } 运行结果( )。
2,2
3,3
4,4
5,5
参考答案:
复制
纠错
相关题目
【单选题】 设有向图D1 = áV3, E3?, 其中 V3 = {v1, v2, v3, v4, v5}, E3 = {áv1, v2?, áv2, v3?, áv3, v2?, áv4, v5?, áv5, v1?},则v2的闭邻域 N(v2)为:
①  {v1, v2, v3};
②  {v1, v3};
③  {v1, v2, v3, v4, v5};
④  {v2}。
【单选题】 设有向图D = áV, E?, 其中 V={v1, v2, v3, v4, v5}, E={áv4, v1?, áv1, v1?,áv1, v2?,áv1, v3?, áv3, v1?, áv5, v3?},则v1的邻域 N(v1) =
①  {v3, v4};
②  {v2, v3,v4};
③  {v1, v2, v3, v4};
④  {v2,v3}。
【单选题】 设有向图D = áV, E?, 其中 V={v1, v2, v3, v4, v5}, E={áv4, v1?, áv1, v1?,áv1, v2?,áv1, v3?, áv3, v1?, áv5, v3?},则v1的闭邻域 N(v1) =
①  {v3, v4};
②  {v2, v3,v4};
③  {v1, v2, v3, v4};
④  {v2,v3}。
【单选题】 设无向图G1 = áV1, E1?, 其中, V1 = {v1, v2, v3, v4, v5}, E1 = {(v1, v2), (v2, v3), (v3, v4), (v3, v3), (v4, v5)},则v2的邻域 N(v2)为:
①  {v1, v2, v3};
②  {v1, v3};
③  {v1, v2, v3, v4, v5};
④  {v2}。
【单选题】 设有向图D = áV, E?, 其中 V={v1, v2, v3, v4, v5}, E={áv4, v1?, áv1, v1?,áv1, v2?,áv1, v3?, áv3, v1?, áv5, v3?},则v1的先驱元集G -(v1) =
①  {v3, v4};
②  {v1, v3,v4};
③  {v1, v2, v3, v4};
④  {v2,v3}。
【单选题】 设有向图D = áV, E?, 其中 V={v1, v2, v3, v4, v5}, E={áv4, v1?, áv1, v1?,áv1, v2?,áv1, v3?, áv3, v1?, áv5, v3?},则v1的后继元集G +(v1) =
①  {v3, v4};
②  {v1, v3,v4};
③  {v1, v2, v3, v4};
④  {v2,v3}。
【单选题】 下述程序的运行结果( )。 #includevoid main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); } case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); }
①  a=1,b=1
②  a=2 ,b=1
③  a=2,b=2
④  a=3,b=3
【单选题】 下述程序的运行结果( )。 #includevoid main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2:a++;b++; } printf(a=%d,b=%d\n,a,b); }
①  a=2,b=1
②  a=1,b=2
③  a=0,b=1
④  a=1,b=0
【单选题】 已知有向图G=(V,E),其中V={V1,V2,V3,V4,V5,V6,V7},E={V1,V2V1,V3V1,V4V2,V5V3,V5V3,V6V4,V6V5,V7V6,V7},G的拓扑序列是( )。
①  V1,V3,V4,V6,V2,V5,V7
②  V1,V3,V2,V6,V4,V5,V7
③  V1,V3,V4,V5,V2,V6,V7
④  V1,V2,V5,V3,V4,V6,V7
【单选题】 有以下程序,程序运行以后的输出结果是() #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
随机题目
【单选题】 On this calendar you can find elective classes as well as review sessions and other events that were not part of ( ) class or exam time.
①  mandate
②  mandator
③  mandated
④  mandatory
【单选题】 The related ( ) are sufficient for you to collect the information you need for your presentation.
①  public
②  publications
③  republic
④  in public
【单选题】 Most of the runners in the London Marathon are raising money ( ).
①  in return
②  out of curiosity
③  for charity
④  on duty
【单选题】 I found the article while I was ( ) some old magazines.
①  browsing through
②  looking into
③  staring at
④  watching out
【单选题】 She travelled the world in ( ) of her dreams.
①  terms
②  preference
③  spite
④  pursuit
【单选题】 ( ) he finished writing the composition in such a short time surprised us all.
①  What
②  How
③  That
④  If
【单选题】 Im very much afraid that your wife may be ( ) in the crime.
①  involvement
②  involved
③  involve
④  involves
【单选题】 They looked at the ( ) of the dancing waves in the sunlight.
①  sparkly
②  sparkle
③  sparker
④  sparking
【单选题】 People walk around ( ) nineteenth-century clothes.
①  wearing
②  wore
③  wear
④  worn
【单选题】 The ( ) of this approach is a lack of clear leadership.
①  merit
②  advantage
③  virtue
④  downside