【单选题】【消耗次数: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
随机题目
【多选题】 党的二十大报告指出,全面建成社会主义现代化强国,总的战略安排是分两步走:()。
①  从二〇二〇年到二〇三五年基本实现社会主义现代化
②  从二〇二〇年到二〇三五年基本实现共产主义
③  从二〇三五年到本世纪中叶把我国建成富强民主文明和谐美丽的社会主义现代化强国
④  从二〇三五年到本世纪中叶把我国建成富强民主文明和谐美丽的共产主义国家
【单选题】 Their inability to say “no”and strong sense of duty towards others make itimpossible for them to avoid unreasonable demands.
①  laterally
②  locally
③  practically
④  collectively
【单选题】 Pleasethe use of insecticides to the evening and do not spray plants that are in flower.
①  expose
②  confine
③  present
④  refer
【单选题】 The size of the window seems out ofwith the height of the wall.
①  fashion
②  consideration
③  proportion
④  production
【单选题】 The plotaround early American settlers and the Indians and a conflict between good and evil.
①  revolves
②  involves
③  evolve
④  dissolves
【单选题】 The company has consistentlythe products it offers and is likely to continue to move into new services and countries.
①  diversified
②  exemplified
③  identified
④  simplified
【单选题】 Some creatures are masters of disguise; they can easilytheir environment.
①  weaveinto
②  blend into
③  break into
④  step into
【单选题】 Fulfilling one’s true potential requires setting appropriate goals and exerting theto accomplish them.
①  self-criticism
②  self-doubt
③  self-discipline
④  self-employment
【单选题】 The comedian left behind an impressive andbody of work, making himself a cultural icon.
①  timeless
②  tasteless
③  tireless
④  thoughtless
【单选题】 Scientists are hoping for ain the search for a cure for cancer.
①  breakthrough
②  breakdown
③  breakup
④  breakout