【单选题】【消耗次数: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
随机题目
【简答题】 设 p: 2+3=5. q: 大熊猫产在中国. r: 复旦大学在广州. 则复合命题公式“(r? (pùq)) ? ?p”的真值为:[填空1]
【简答题】 Translate the following sentence into English.相对于在百货商店购物我更喜欢在网上购物,因为它更加方便和省时。
【简答题】 Translate the following sentence into English.你讲什么内容并不重要,重要的是你必须要演讲。
【简答题】 Direction: Fill in the blanks with the words given below. Change the form if necessary.[vain; frame; curve; twist; comb; collapse; scatter; scratch; rebuild; harsh]5. The horses liked this grooming, and I think, if they could talk, they would tell you where to[填空1]or comb.
【简答题】 Direction: Fill in the blanks with the words given below. Change the form if necessary.[expand; abuse; knowledge; narrative; plantation; property; oppressive; extremely; rebel; abolitionist]6. If someone takes away your[填空1]in that country, you have no recourse.
【简答题】 Direction: Fill in the blanks with thephrases given below. Change the form if necessary.[ought to; look forward to; in wonder; give way to; look down; on the way to; reach out; put one’s arm around; trip over; cut into]1. My dear, do not[填空1]such gloomy thoughts. Let us hope for better things.
【简答题】 Direction: Fill in the blanks with the words given below. Change the form if necessary.[dodge; mean; tease; disability; regular; bonus; proclaim; universal]7. Hell be glad to be in[填空1]work again.
【简答题】 设函数f: R+?R, f(x)=x2-3x-5,试求其单满双射性质。
【简答题】 求集合 A={2, 3, 4}上的恒等关系、全域关系、小于等于关系和整除关系。
【简答题】 设函数f: N?N, f(x)=2x+1,试求其单满双射性质。