• 2021-04-14
    以下程序段运行后的输出结果是( )。intx=1,y=0;if(!x)y++;elseif(x==0)if(x)y+=2;elsey+=3;printf("%d\n",y);? 0|2|1|3
  • 0

    内容

    • 0

      【单选题】分段函数: ,下面程序段中正确的是__________。 A. If x < 0 Then y = 0 If x < 1 Then y = 1 If x < 2 Then y = 2 If x >= 2 Then y = 3 B. If x >= 2 Then y = 3 If x >= 1 Then y = 2 If x > 0 Then y = 1 If x < 0 Then y = 0 C. If x < 0 Then y = 0 ElseIf x > 0 Then y = 1 ElseIf x > 1 Then y = 2 Else y = 3 End If D. If x > =2 Then y = 3 ElseIf x > =1 Then y = 2 ElseIf x > =0 Then y = 1 Else y = 0 End If

    • 1

      有以下程序, 程序运行后的输出结果是______ #include int main() { int x=3,y=0; switch (x) { default: y++; case 2: y++; case 4: y+=x; } printf("%d\n",y); } A: 1 B: 0 C: 2 D: 5

    • 2

      执行以下程序段输出结果为______。...intx=1,y=-1,z=0;if(x<y)if(y<0)z=0;elsez+=2;printf("%d\n",++z);...

    • 3

      int x = 3,y = 4;以下哪条输出语句正确? A: Console.WriteLine(&quot;x={x},y={y}&quot;, x,y); B: Console.WriteLine(&quot;x={x},y={y}&quot;); C: Console.WriteLine(&quot;x={0},y={1}&quot;, x,y); D: Console.WriteLine(&quot;x={1},y={2}&quot;, x,y);

    • 4

      阅读如下程序段,则执行后程序的输出结果是()。main(){structa{intx;inty;}num[2]={{20,5},{6,7}};printf(&quot;%d\n&quot;,num[0].x/num[0].y*num[1].y);}? 0|20|28|5