if(a>0)
s=s+1;
if(a>b)
t=s+1;
elseif (a==b) t=5;
else t=2*s;
printf("%d\n",t);
}
if(a>0)
s=s+1;
if(a>b)
t=s+1;
elseif (a==b) t=5;
else t=2*s;
printf("%d\n",t);
}
当前位置:首页 > 高级语言程序设计(一)(00342) > 正文内容

为了使运行下列程序后输出4,则输入的a和b值应满足的条件是()
main()
{int s=1,t=1,a,b;
scanf("%d,%d",&a,&b);
if(a>0)
   s=s+1;
if(a>b)
    t=s+1;
   elseif (a==b) t=5;
else  t=2*s;
printf("%d\n",t);
}
高老师2年前 (2024-03-26)高级语言程序设计(一)(00342)14

为了使运行下列程序后输出4,则输入的a和b值应满足的条件是()
main()
{int s=1,t=1,a,b;
scanf("%d,%d",&a,&b);
if(a>0)
   s=s+1;
if(a>b)
    t=s+1;
   elseif (a==b) t=5;
else  t=2*s;
printf("%d\n",t);
}

A.a〉b

B.a〈b〈0

C.0〈a〈b

D.0〉a〉b

正确答案是C

扫描二维码免费使用微信小程序搜题/刷题/查看解析。

版权声明:本文由翰林刷题小程序授权发布,如需转载请注明出处。

本文链接:https://doc.20230611.cn/post/442808.html

分享给朋友: