阅读下列程序,则运行结果为#include "stdio.h"fun(){ static int x=5;x++;return x;}main(){ int i,x;for(i=0;i<3;i++)x=fun();printf("%d\n",x);}
A.5
B.6
C.7
D.8
A.5
B.6
C.7
D.8
阅读下列程序,则运行结果为 #include"stdio.h" fun() { static int x=5; x++; return x;} main() { int i,x; for(i=0;i<3;i++) x=fun(); printf("%d\n",x);}
A.5
B.6
C.7
D.8
A.5
B.6
C.7
D.8
A.5
B.6
C.7
D.8
阅读下列程序片段。 Public void test{ Try{ sayHello; system.out.println("hello"): }catch(ArraylndexOutOfBoundException e){ System.out.println("ArraylndexOutOfBoundExcep— tion"); }catch(Exception e){ System.out.println("Exception"): }finally{ System.Out.println("finally"); } } 如果sayHello方法正常运行,则test方法的运行结果将是()。
A.Hello
B.ArraylndexOutOfBondsException
C.Exception Finally
D.Hello Finally
阅读下列程序,则在执行后,程序的运行结果为 #include"stdio.h" #include"string.h" main() { char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s\n",a);}
A.nice to meet you you
B.nice to
C.meet you you
D.nice to you
阅读下列程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击一次窗体,再单击命令按钮,将显示一个输入对话框,如果在对话框中输入20,则程序的输出结果为
A.0
B.20
C.40
D.无任何输出
阅读下列代码:publicclassTest{publicstaticvoidmain(Stringargs[]{System.out.println(100%3);System.out.pnntln(100%3.0);}}程序运行结果为()。
A.1和1
B.1和1.0
C.1.0各1
D.1.0和1.0