分析下列程序中类MyClass的定义 class BaseClass { public int i; } class MyClass:BaseClass { public new int i; } 则下列语句在Console 上的输出为【 】。 MyClass y = new MyClass(); BaseClass x = y; x.i = 100; Console.WriteLine("{0}, {1}",x.i,y.i);
分析下列程序中类MyClass的定义 class BaseClass { public int i; } class MyClass:BaseClass { public new int i; } 则下列语句在Console 上的输出为【 】。 MyClass y = new MyClass(); BaseClass x = y; x.i = 100; Console.WriteLine("{0}, {1}",x.i,y.i);
分析下列程序中类MyClass的定义 则下列语句在Console 上的输出为()。 MyClass y = new MyClass(); BaseClass x = y; x.i = 100; Console.WriteLine("{0}, {1}",x.i,y.i); A: 0, 0 B: 100, 100 C: 0, 100 D: 100, 0
分析下列程序中类MyClass的定义 则下列语句在Console 上的输出为()。 MyClass y = new MyClass(); BaseClass x = y; x.i = 100; Console.WriteLine("{0}, {1}",x.i,y.i); A: 0, 0 B: 100, 100 C: 0, 100 D: 100, 0
下面属于弱拍开始的音乐节奏有 A: 2/4 X X I X X I B: 3/4 0 0 X I X X X I C: 4/4 0 X I X X X X I D: 3/4 X X X I 0 X 0 I
下面属于弱拍开始的音乐节奏有 A: 2/4 X X I X X I B: 3/4 0 0 X I X X X I C: 4/4 0 X I X X X X I D: 3/4 X X X I 0 X 0 I
设有n个数按从大到小的顺序存放在数组x中,以下能使这n个数在x数组中的顺序变为从小到大的是( ) A: for(i=0;i<;n/2;i++){ t=x[i];x[i]=x[n-i-1];x[n-i-1]=t;} B: for(i=0;i<;n;i++){ t=x[i];x[i]=x[n-i-1];x[n-i-1]=t;} C: for(i=0;i<;n/2;i++){ t=x[i];x[i]=x[n-i+1];x[n-i+1]=t;} D: for(i=0;i<;n/2;i+=2){ t=x[i];x[i]=x[n-i-1];x[n-i-1]=t;}
设有n个数按从大到小的顺序存放在数组x中,以下能使这n个数在x数组中的顺序变为从小到大的是( ) A: for(i=0;i<;n/2;i++){ t=x[i];x[i]=x[n-i-1];x[n-i-1]=t;} B: for(i=0;i<;n;i++){ t=x[i];x[i]=x[n-i-1];x[n-i-1]=t;} C: for(i=0;i<;n/2;i++){ t=x[i];x[i]=x[n-i+1];x[n-i+1]=t;} D: for(i=0;i<;n/2;i+=2){ t=x[i];x[i]=x[n-i-1];x[n-i-1]=t;}
声明一个变量为局部变量应该用( )。 A: Private Sub Command1 Click() n=5:x=1 Do X=X * I I=I + 1 Loop While I < n Print x End Sub B: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X*I I=I + 1 Loop While I <n Print x End Sub C: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I<=n Print X End Sub D: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I>n Print X End Sub
声明一个变量为局部变量应该用( )。 A: Private Sub Command1 Click() n=5:x=1 Do X=X * I I=I + 1 Loop While I < n Print x End Sub B: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X*I I=I + 1 Loop While I <n Print x End Sub C: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I<=n Print X End Sub D: Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I>n Print X End Sub
3、float x=2.1; i=(int)x; 时,以下语句执行后, x=______ , i=______ 。printf(“x=%f, i=%d”, x, i);}
3、float x=2.1; i=(int)x; 时,以下语句执行后, x=______ , i=______ 。printf(“x=%f, i=%d”, x, i);}
使用数组x输出10个1-100之间的随机整数(包括1和100),下列命令中正确的是:( ) A: Dim x(9) As Integer For i = 1 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next B: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Rnd(10) Print x(i); Next C: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 ) Print x(i); Next D: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next
使用数组x输出10个1-100之间的随机整数(包括1和100),下列命令中正确的是:( ) A: Dim x(9) As Integer For i = 1 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next B: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Rnd(10) Print x(i); Next C: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 ) Print x(i); Next D: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next
若定义:int i=101,x; 求执行语句while( x=i-- ); 后x与i 的值 ( )。 A: x=0,i=-1 B: x=101,i=100 C: x=0,i=0 D: x=-1,i=-1
若定义:int i=101,x; 求执行语句while( x=i-- ); 后x与i 的值 ( )。 A: x=0,i=-1 B: x=101,i=100 C: x=0,i=0 D: x=-1,i=-1
int main() { float x=3.6; int i; i=(int)x; printf("x=%f,i=%d\n",x,i); return 0; }
int main() { float x=3.6; int i; i=(int)x; printf("x=%f,i=%d\n",x,i); return 0; }
把x数组各元素逆序存入数组y写作:for(i=0;i<;n;i++)________; A: y[i]=x[i] B: y[i]=x[n-i] C: y[n-i]=x[i] D: y[i]=x[n-i-1]
把x数组各元素逆序存入数组y写作:for(i=0;i<;n;i++)________; A: y[i]=x[i] B: y[i]=x[n-i] C: y[n-i]=x[i] D: y[i]=x[n-i-1]