main() { int x=1,a=0,b=0; switch(x) { case 0:b++; case1:a++; case2:a++;b++; } printf("a=%d,b=%d\n",
main()
{ int x=1,a=0,b=0;
switch(x)
{ case 0:b++;
case1:a++;
case2:a++;b++;
}
printf("a=%d,b=%d\n",a,b);
}
该程序的输出结果是
a=1,b=0
(ps:case1后面没加break,应该会执行case2的吧,请指教,
答案为什么是a=1,b=0呢,如果继续执行case 2语句的话应该是a=2,b=1的啊?
人气:313 ℃ 时间:2020-06-06 02:34:25
解答
case后面请加空格谢谢
推荐
- main() { int x; scanf("%c",x); switch(x) { case,^a^;printf("123456789"); break; case,^s^;printf("78
- main() { int x=1,a=0,b=0; switch(x){ case 0:b++; case 1:a++; case 2:a++;b++
- 下列程序的输入结果是 main() {int x=1,a=0,b=0; switch(x){case 0:b++; case 1:a++; case 2:a++;b++; }
- {int x=1,a=0,b=0;switch(x){ case 0:b++; case 1:a++; case 2:a++;b++;} printf("a=%db=%d\n",a,b);
- It is late in the afternoon,A man goes into a__ and shows a coat o the shop assistant
- Trees ___gently in the breeze.
- 当a等于什么整数时,关于xy的方程组x-y-a=0
- 王大爷房前有一块400平方米的空地,他打算用其中的2/5种蔬菜,又打算在这块菜地里按1:3的面积比例种黄瓜和茄子,求黄瓜和茄子的面积各是多少?求速回.
猜你喜欢
- 已知E,FG,H分别为空间四边形ABCD的边AB,BC,CD,DA的中点,若EG⊥ FH,求证AC=BD
- 9上语文第4课蝈蝈和蛐蛐中当所有的鸟儿因骄阳而昏晕一句在文中起什么作用
- 1、超市两次降低电磁炉的售价,第一次比原价降低了20%,
- The reason why English has changed over time is ______ all languages change and develop
- 表示与什么相关 英语怎么说
- 英语作文 未来的房子
- 一个两位数的两个数字之和为6,将十位数与个位数对调以后再加上18,仍得原数,求这两位数.
- 函数y=2/1x中自变量x的取值范围是