网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
在执行以下程序时,为了使输出结果为t=4,给a和b输入的值应该满足的条件是_______。 main() { int s,t,a,b; scanf("%d%d",&a,&B) ; s=1;t=1; if(a>0)s=s+1; if(a>B) t=s+t; else if(a==B) t=5; else t=2*s; printf("t=%d\n",t); }
A.a>b
B.a<b<0
C.0<a<b
D.0>a>b
参考答案
更多 “ 在执行以下程序时,为了使输出结果为t=4,给a和b输入的值应该满足的条件是_______。 main() { int s,t,a,b; scanf("%d%d",a,B) ; s=1;t=1; if(a>0)s=s+1; if(a>B) t=s+t; else if(a==B) t=5; else t=2*s; printf("t=%d\n",t); }A.a>bB.a<b<0C.0<a<bD.0>a>b ” 相关考题
考题
在执行以下程序时,为了使输出结果为:t=4,则给a和b输入的值应满足的条件是______。main (){ int s,t,a,b; scanf("%d,%d",a,b); s=1, t=1; if(a>0)s=s+1; if(a>b)t=s+1; else if (a==b) t=5; else t=2*s; printf("%d\n",t);}A.a>bB.a<b<0C.0<a<bD.0>a>b
考题
在执行以下程序时,为了使输出结果为t=4,则给a和b输入的值应当满足的条件是______。 a=InputBox(“a=”) b=InputBox(“b=”) s=1 t=1 If a>0 Then s=s+1 End If If a>b Then t=s+1 Else If a=b Then t=5 Else t=2*s End If End If Print tA.a>bB.a<b<0C.0<a<bD.0>a>b
考题
请选出以下程序的输出结果_______。 includesub(int*s,inty){ static int t=3,y=s[t];t
请选出以下程序的输出结果_______。 #include<stdio.h> sub(int*s,inty) { static int t=3, y=s[t];t-; } main() { int a[]={1,2,3,4},i,x=0; for(i=0;i<4;i++){ sub(a,x);printf("%d",x);} printf("\n"); }A.1234B.4321C.0D.4444
考题
请选出以下程序的输出结果()。includesub(int *s,int y){static int t=3; y=s[t];t--;}
请选出以下程序的输出结果( )。 #include <stdio.h> sub(int *s,int y) { static int t=3; y=s[t];t--; } main() { int a[]={1,2,3,4},i,x=0; for(i=0;i<4;i++) { sub(a,x);printf("%d",x); } printf("\n"); }A.1234B.4321C.0D.4444
考题
以下程序的输出结果是( )。 include void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main
以下程序的输出结果是( )。 include<stdio.h> void swap(int*a,int*B){int*t; t=a;a=b;b=c;} main() {int i=3,j=5,*p=i,*q=j; swap(p,q);printf("%d %d\n",*p,*q); }
考题
在执行以下程序时,为了使输出结果为t=4, 则给a和b输入的值应满足的条件是() #include<stdio.h> void main() { int s,t,a,b; scanf("%d,%d",a,b); s=1; t=1; if(a < 0) s=s+1; if(a > b) t=s+1; else if(a= =b) t=5; else t=2*s; printf("t=%dn",t); }A.0 > a > bB.a=0 < bC.a=b < 0D.a < b < 0
考题
若下列程序执行后t的值为4,则执行时输入a,b的值范围是 #include ”stdio.h” main() { int a, b, s=1, t=1; scanf (”%d, %d”, a, b); if (a>0) s+=1; if (a>b) t+=s; else if(a==b) t=5; else t = 2*s; printf (”s=%d, t=%dn”, s,t); }
考题
【填空题】请阅读以下程序,为使输出时t值为4,输入量a和b应满足的条件是 。 main() {int s,t,a,b; scanf("%d,%d",a,b); s=1;t=1; if(a>0) s=s+1; if(a>b) t=s+t; else if(a==b) t=5; else t=2*s; printf("s=%d,t=%d",s,t); }
考题
3、若下列程序执行后t的值为4,则执行时输入a,b的值范围是 #include ”stdio.h” main() { int a, b, s=1, t=1; scanf (”%d, %d”, a, b); if (a>0) s+=1; if (a>b) t+=s; else if(a==b) t=5; else t = 2*s; printf (”s=%d, t=%d\n”, s,t); }
热门标签
最新试卷