有以下程序 fun(intx,inty,intz) {z=x*y;} main() {inta=4,b=2,c=6; fun(a,b,c); print
有以下程序
fun(int x,int y,int z)
{ z=x*y;}
main()
{int a=4,b=2,c=6;
fun(a,b,c);
printf("%d",c);
}
程序运行后的输出结果是
A.16
B.6
C.8
D.12
有以下程序
fun(int x,int y,int z)
{ z=x*y;}
main()
{int a=4,b=2,c=6;
fun(a,b,c);
printf("%d",c);
}
程序运行后的输出结果是
A.16
B.6
C.8
D.12
以下程序的输出结果是 【11】 。
int fun(int x,int y,int *p,int *q)
{ *p=x*y;
*q=x/y;}
main()
{int a,b,c,d;
a=4;b=3;
fun(a,b,&c,&d);
printf("%d,%d\n",c,d);}
A.27.4
B.26.44
C.12.4
D.程序有误
有下列程序:
#include<stdi0.h>
intf(intx)
{
inty;
if(x==0‖x==1)return(3);
y=x*x-f(X-2);
returny;
}
voidmain()
{
intZ;
z=f(3);printf("%d\n",z);
}
程序的运行结果是()。
A.0
B.9
C.6
D.8
A.max=3
B.max=4
C.max=5
D.max=6
有以下程序: classDate { public: Date(inty,intm,intd); { year=Y: month=m; day=d; } Date(inty=2000) { year=y; month=10; day=1; } Date(Date&d)
{ year=d.year; month=d.month; day=d.day; } voidprint() { cout<<year<<"."<(month<<"."<<day<<endl; } private: intyear,month,day; }; Datefun(Dated) { Datetemp; temp=d; returntemp; } intmain() { Datedatel(2000,1,1),date2(0,0,0); Datedate3(datel); date2=fun(date3); return0; } 程序执行时,Date类的拷贝构造函数被调用的次数是()。
A.2
B.3
C.4
D.5
有以下程序: classDate {public: Date(inty,intm,intd); {year=Y; month=m; day=d;} Date(inty=2000) {year=y; month=10; day=1;} Date(Date&d) {year=d.year; month=d.month; day=d.day;} voidprint() {cout<<year<<"."<<month<"."<< day<<endl;} private: intyear,month,day;}; Datefun(Dated) {Datetemp; temp=d; returntemp;} intmain() {Datedatel(2000,1,1),date2(0,0,O); Datedate3(date1); date2=fun(date3); return0;} 程序执行时,Date类的复制构造函数被调用的次数是()。
A.2
B.3
C.4
D.5
有如下程序: #include<iostream> usingnamespacestd; voidf1(int&X,int&y){intz=x;x=y;y=z;}voidf2(intX,inty){intz=x;x=y;y=z;}intmain(){ intx=10,y=26; f1(x,y); f2(x,y); cout<<y<<endl; return0; } 运行时的输出结果是()。
A.10
B.16
C.26
D.36
有以下程序: fun (int a, int b) { if (a>b) return (a); else return(b); } main () { int x=3, y=8, z=6, r; r=fun(fun(x,y) , 2*z); printf("%d\n", r); } 程序运行后的输出结果是
A.3
B.6
C.8
D.12