如有定义语句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 ( x%2){ case 0.0: a++; break; case 1.0: b++; break; default: a++; b++; }
D.
switch ( (int)x%2 ){ case 0: a++; break; case 1: b++; break; default: a++; b++; }