A、y=563
B、y=9
C、y=-735
D、y=564
第1题:
下列程序的运行结果为( )。 #define MAX(x,y)(x)>(y)?(x):(y) main() { int a=2,b=3,c=1,d=3,t; printf("%d\n",(MAX(a+b,c+d))*100); }
A.500
B.5
C.4
D.400
第2题:
下列函数定义中,会出现编译错误的是 ______。
A.max(int x,int y,int *z) { *z=x>y? x:y;}
B.int max(int x,y) {int z; z=x>y? x;y; return z; }
C.max(int x,int y) { int z; z=x>y? x:y; return(z); }
D.int max(int x,int y) { return(x>y?x:y);}
第3题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:Private Sub Command1_ Click() Static x As Integer Static y As Integer Cls y=1 y=y+5 x=y +x Print x, yEnd Sub程序运行时,三次单击命令按钮Command1后,窗体上显示的结果为______。
A.15 16
B.15 6
C.15 15
D.5 6
第4题:
有以下程序段: #include<iostream.h> #define MAX(x,y)(x)>(y)?(x):(y) void main() { int i,j,k; i=10; j=15;k=MAX(i,j)*10; cout<<k<<end1; } 程序执行后的输出结果是( )。
A.15
B.100
C.150
D.10
第5题:
窗体中有命令按钮Command1,事件过程如下:
Public Function f(x As Integer)As Integer
Dim y As Integer
x=20
y=2
f=x*Y
End Function
Private Sub Command 1_Click()
Dim y As Integer
static x As Integer
x=10
y=5
y=f(x)
Debug.Print x;y
End Sub
运行程序,单击命令按钮,则立即窗口中显示的内容是( )。
A.10 5
B.10 40
C.20 5
D.20 40
第6题:
下面程序的输出结果是( )。 #include<iostream> using namespace std; template<class T> T max(T x,T y) { return(x>= y ? x:y);} template<class T> T max(T x,T y,T z) { T t; t=(x>=y ? x:y); return(t>=z ? t:z); } void main(){ int x = 10,y=18,maxi; float a = 1.2,b = 3.2,c = 2,max2; max1 = max(x,(int)c); max2 = max(a,b,(float)y); cout<<maxi<<endl; cout<<max2<<endl;
A.18 3.2
B.10 18
C.10 3.2
D.编译出错
第7题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序: Private Sub Command1-Click() Static X Am Integer Static Y As Integer Cls Y=1 Y=Y+5 X=5+X Print X,Y End Sub程序运行时,三次单击命令按钮Comand1后,窗体上显示的结果为______。
A. 15 16
B.15 6
C.15 15
D.5 6
第8题:
在窗体上画一个名称为Command1的命令按钮,并编写如下程序: Private Sub Command1_Click( ) Dim x As integer Static y As integer x=10 y=5 Call f1(x,y) Print x,y End Sub Private Sub f1(ByRef xl As Integer,y1 As Integer) x1=x1+2 y1=y1+2 End Sub 程序运行后,单击命令按钮,在窗体上显示的内容是
A.10 5
B.12 5
C.10 7
D.12 7
第9题:
则P(max{X,y}>1)=_______.
得X~E(2),同理Y~E(3),且X,Y独立.P(max{X,Y}>1)=P(X>1Y>1)=1-P(X≤1,Y≤1)=1-P(X≤1)P(Y≤1)
第10题:
运行如下程序后,命令窗口(commandwindows)显示的结果为()A=[13,-56,78;25,63,-735;78,25,563;1,0,-1];y=max(max(A))
第11题:
)int x,y;char z;Max(x,y,z);
)double x,y,z;Max(x,y,z);
)int x,y;float z;Max(x,y,z);
)float x;double y,z;Max(x,y,z);
第12题:
y=564
y=9
y=-735
y=563
第13题:
在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Private Sub Commandl_Click( )
Static X As Integer
Static Y As Integer
Cls
Y=1
Y=Y+5
X=5+X
Print X, Y
End Sub
程序运行时,3次单击命令按钮Command1后,窗体上显示的结果为【 】。
第14题:
下列函数定义中,会出现编译错误的是
A.max(int x,int y,int *z) { *z=x>y ? x:y; }
B.int max(int x,y) { int z; z=x>y ? x:y; return z; }
C.max(int x,int y) { int z; z=x>y?x:y; return(z); }
D.int max(int x,int y) { return(x>y?x:y); }
第15题:
在窗体上画一个名称为Commandl的命令按钮,然后编写如下程序: Private Sub Command1_Click() Static X As Integer Static Y As Integer Cls Y = 1 Y = Y + 5 X = 5 + X Print X, Y End Sub 程序运行时,三次单击命令按钮Commandl后,窗体上显示的结果为
A.15 16
B.15 6
C.15 15
D.5 6
第16题:
在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Pnvate Sub Command1_Click() Dim x As Integer,y As Integer,t As Integer x=10:y=20:t=0 If x=y Then t=x:x=y:y=t Print x;y End Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。
A.10 20
B.20 0
C.20 10
D.20 20
第17题:
在窗体上画一个名称为Command1的命令按钮,并编写如下程序: Private Sub Command1_Click( ) Dim x As Integer Static y As Integer x=10 y=5 Call f1(x,y) Print x,y End Sub Private Sub f1(ByRef x1 As Integer,y1 As Integer) x1=x1+2 y1=y1+2 End Sub程序运行后,单击命令按钮,在窗体上显示的内容是
A.10 5
B.12 5
C.10 7
D.12 7
第18题:
下列程序的输出结果为【 】。
inelude<iostream. h>
int &max(int &x, int &y)
{return (x>y? x: y); }
void main() {
int n=3, m=12;
max(m, n)++
cout<<"m="<<m<<", n= "<<n<<end1;
}
第19题:
下列函数定义不正确的是 ( )
A.int max { int x y,z; z=x>y? x: y }
B.int max(x,y) int x,y; { int z; z=x>y? x:y; return(z) }
C.int max(x,y) { int x,y z; z=x>y? x: y; return(z); }
D.int max( ) {}
第20题:
在窗体上画一个名称为Command1的命令按钮,并编写如下程序: Public x As Integer
Private Sub Command1_Click()
Dim y As Integer
x=10 : y=5
Call f(x, y)
Print x; y
End Sub
Private Sub f(x1 As Integer, y1 As Integer)
x1=x+2
y1=y+2
End Sub
程序运行后,单击命令按钮,在窗体上显示的内容是( )。
A. 10 5
B. 12 7
C. 12 2
D. 以上都不对
第21题:
假设有函数模板定义如下:template< typename T >Max(T a,T b,T&c){c=a+b;}下列选项正确的是()
第22题:
下面程序段求两个数中的大数,不正确的是()。
第23题:
Max=IIf(x>y,x,y)
If x>y Then Max=x Else Max=y
Max=x:If y>=x Then Max=y
If y>x Then Max=y:Max=x