• 2022-07-26
    若a和b均是整型变量,以下正确的switch语句是【】
    A: switch (a/b)
    { case 1: case 3.2: y=a+b; break ;
    case 0: case 5: y=a-b;
    }
    B: switch (a*a+b*b);
    {case 3:
    case 1: y=a+b; break ;
    case 0: y=b-a; break; }
    C: switch a
    {default : x=a+b;
    case 10 : y=a-b;break;
    case 11 : y=a*d; break;}
    D: switch(a+b)
    {case 10: x=a+b; break;
    case 11: y=a-b; break;
    }
  • 举一反三