首页 > 中学考试杂题 > 题目详情
若有定义语句int a,b; double x;下列选项中没有错误的是A)switch ( x%2){case 0 :a
题目内容:
若有定义语句int a,b; double x;下列选项中没有错误的是
A)switch ( x%2)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
B)switch ( (int)x%2.0)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
C)switch ( (int)x%2)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
A)switch ((int)(x)%2)
{case 0.0 :a++;break;
case 1.0 :b++;break;
default :a++;b++;
}
若有定义语句int a,b; double x;下列选项中没有错误的是
A)switch ( x%2)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
B)switch ( (int)x%2.0)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
C)switch ( (int)x%2)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
A)switch ((int)(x)%2)
{case 0.0 :a++;break;
case 1.0 :b++;break;
default :a++;b++;
}
A)switch ( x%2)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
B)switch ( (int)x%2.0)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
C)switch ( (int)x%2)
{case 0 :a++;break;
case 1 :b++;break;
default :a++;b++;
}
A)switch ((int)(x)%2)
{case 0.0 :a++;break;
case 1.0 :b++;break;
default :a++;b++;
}
本题链接: