两次运行下面的程序,如果从键盘上分别输入3和2,则输出结果是( )。 #include<stdio.h> main() {int x; scanf("%d",&x); if(x++>2)printf("%d",x); else printf(“%d\n",x--); }
A.4和3
B.4和2
C.4和1
D.3和2
第1题:
若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。 #include<stdio.h> main() { int a,b,s; scanf("%d%d",&a,&b); s=a; if(a<b) s=b; s=s*s; printf("%d\n",s); }
A.1
B.4
C.2
D.9
第2题:
若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。
#include<stdio.h>
main()
{ int a,b,s;
scanf("%d%d",&a,&B) ;
S=a;
if(a<B) s=b;
s=s*s;
printtf("%d\n",s);
}
A.1
B.4
C.2
D.9
第3题:
两次运行下面的程序,如果从键盘上分别输入10和8,则输出结果为 ______。 #include<iostream.h> viod main(){ int x: cin>>x: if(x++>9)cout<<x; else cout<<x—<<endl; }
A.11和8
B.11和9
C.10和8
D.10和9
第4题:
若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。 #include<stdio.h> main() { int a,b,s; scanf("%d%d",&a,&b); s=a; if(a<b) s=b; S=S*S, printf("%d\n",s); }
A.1
B.4
C.2
D.9
第5题:
两次运行下面的程序后,如果从键盘上分别输入7和3,则输出结果是______。 main() { int x; scanf("%d",&x); if(++x>5)printf("%d",x); else printf("%d\n",x--); }
A.7和5
B.6和3
C.7和4
D.8和4