更多"下面程序和运行运行结果是【 】。
typedef union"的相关试题:
[填空题]下面程序和运行运行结果是【 】。
typedef union student
{ char name [10];
long sno;
char sex;
float score [4];
} STU;
main ( )
{ STU a[5];
prinff( "% d/n", sizeof(a) );
}
[填空题]
下面程序和运行运行结果是 【19】 。
typedef union student
{ char name [10];
long sno;
char sex;
float score [4];
} STU;
main ( )
{ STU a[5];
prinff( "% d/n", sizeof(a) );
}
[填空题]下面程序的运行结果是______。
typedef union student
char name[10];
long sno;
char sex;
float score[4];
STU;
main( )
STU a[5];
printf("%d/n",sizeof(A) );
[单项选择]下面程序运行的结果是( )。
#include<iostream>
using namespace std;
class A
protected:
int a;
public:
void input(int i)
a=i;
;
class B
protected:
int a;
public:
void input(int j)
a=j;
;
class C: public A, public B
int x;
public:
void input( )
x=A::a * B::a;cout<<x<<endl;
;
void main( )
C c;
c.A::input(5);
c.B::input(8);
c.input( );
A. 5
B. 8
C. 40
D. 编译出错
[填空题]下面程序运行输出的结果是 【9】 。
#include <iostream>
using namespace std;
int main( )
char a[]="Chinese";
a[3]=’/0’;
cout<<a<<endl;
return 0;
[单项选择]下面程序运行后的结果是( )。
Private Sub Form_Click( )
Dim s As Integer,k As Integer,i As Integer,n As Integer
s=1
fori=1 to 3
forj=i to 3
for k=j to istep-1
s=s*k
nextk,J,i
print s
End Sub
A. 6
B. 72
C. 144
D. 432
[填空题]下面程序运行后输出的结果是 【12】 。
#include <iostream>
using namespace std;
class example
const int m;
public:
example(int i):m(i)
void pr( )cout<<"m="<<m<<endl’
;
int main( )
example x(100);
x.pr( );
return 0;
[单项选择]下面程序运行后,单击命令按钮,输出的结果是 Private Sub Command1_Click( ) Dim a%(1 To 4) , b%(2 To 6) , i%, str1#, str2# For i = 1 To 4 a(i) =i Next For i = 2 To 6 b(i) =i Next str 1 = YAG (a) str 2 = YAG (b) Print "str1 ="; str1; "str2 ="; str2 End Sub Function YAG(a( )As Integer) Dim t#,i% t=1 For i=LBound(a)TO UBound(a) t=t * a(i) Next YAG=t End Function
A. str1=24 str2=720
B. str1=12 str2=360
C. str1=24 str2=180
D. str1=36 str2=720