对于元组valt=(1,3.14,"Fred")说法错误的是?()
第1题:
下面程序的输出结果是【 】。
include<iostream>
using namespace std;
int x;
void funA(int&,int);
void funB(int,int&);
int main()
{
int first;
int second=5;
x=6;
funA(first,seconD) ;
fimB(first,seconD) ;
cout<<first<<" "<<second<<" "<<x<<end1;
return 0;
}
void funA(int &a,int B)
{
int first;
first=a+b;
a=2*b;
b=first+4;
}
void funB(int u,int &v)
{
int second;
second=x;
v=second+4;
x=u+v;
}
第2题:
为了使程序的输出的正确结果为: Now is 2004.7.10 10:10:10. 那么应在下列程序划线处填入的正确语句是( )。 那么应在下列程序划线处填入的正确语句是( )。 #include <iostream> using namespace std; class TIME; class DATE { public: DATE(int y=2004,int m=1,int d=1) { year=y; month=m; day=d; } friend void DateTime(DATE &d, TIME &t); private: int year, month, day; }; class TIME { public: TIME(iht h=0, int m=0,int s=0) { hour=h; minute=m; second=s; } friend void DateTime(DATE &d,TIME &t); private: int hour,minute, second; }; ______________________ //函数 DateTime 的首部 { cout<<"Now is"<<d.year<<'.'<<d.month<<'.'<<d.day<< ' '<<t.hour<<":"<<t.minute<<':'<<t.second<<'.'<<end1; } int main ( ) { DATE d(2004,7,10); TIME t(10, 10, 10); DateTime(d,t); return 0; }
A.void DateTime(DATE &d,TIME &t)
B.void TIME::DateTime(DATE &d,TIME &t) const
C.friend void DateTime(DATE &d,TIME &t)
D.void DATE::DateTime(DATE &d,TIME &t)
第3题:
在下面的类定义中,横线处应填入的内容是 class Fred { public: void print () { cout<<data<<end1;} void setData (double D) {data=d; static int count; private: double data; };______count=0; //静态数据成员的定义
A.int
B.static int
C.int Fred::
D.static int Fred::
第4题:
有如下程序: #include<iostream> using namespace std; int main() { void function(double val); double val; function(val); cout<<val; return 0; } void function(double val) { val= 3; } 编译运行这个程序将出现的情况是( )。
A.编译出错,无法运行
B.输出:3
C.输出:3.0
D.输出一个不确定的数
第5题:
______, the second one will start automatically.
A.If the first stand-by set failed
B.If the first stand-by set fails
C.If the first stand-by set will fail
D.If the first stand-by set doesn’t fail
第6题:
对于元组valt=(1,3.14,"Fred")说法不正确的是?()
第7题:
若t为double类型,表达式t=l,t+5,l++的值是()
第8题:
变量x、f、d分别为int,float,double类型的,除了f和d不能等于无穷大和NAN以外值可以任意选取,下面表达式为真的是()
第9题:
若t为double类型,表达式t=1,t+5,t++的值是()。
第10题:
第11题:
If the first stand-by set failed
If the first stand-by set fails
If the first stand-by set will fail
If the first stand-by set doesn’t fail
第12题:
min=1,max=9
min=0,max=9
min=1,max=4
min=0,max=4
第13题:
下面程序的输出结果是______。
include<iostream>
using namespace std;
int x;
void funA(int&,int);
void funB(int,int&);
int main()
{
int first;
int second=5;
x=6;
funA(first,second);
funB(first,second);
cout<<first<<””<<second<<””<<x<<endl;
return 0;
}
void funA(int &a,int b)
{
int first;
first=a+b;
a=2*b;
b=first+4;
}
void funB(int u, int &v)
{
int second;
second=x;
v=second+4;
x=u+v;
}
第14题:
有以下程序: #include <iostream> using namespace std; char *x[]={"First", "Second", "Third" }; void f(char *z[ ]) { cout<<*z++<<end1; } int main ( ) { char **y; y=x; f(y); return 0; }
A.产生语法错误
B.First
C.Secpnd
D.Third
第15题:
使用VC6打开考生文件夹下的工程test27_1,此工程包含一个源程序文件test27_1.cpp,但该程序运行有问题,请改正函数中的错误,使该程序的输出结果为;
100
源程序文件test27_1.cpp清单如下:
include <iostream.h>
template <class T>
class pair
{
T valuel, value2;
public:
pair (T first, T second)
{valuel=first; value2=second;}
/***************** found *****************/
char getmax ();
};
/***************** found *****************/
T pair<T>::getmax ()
{
T retval;
/***************** found *****************/
retval = valuel>value2?? value1 : value2;
return retval;
}
void main ()
{
pair <int> myobject (100, 75);
cout << myobject.getmax()<<end1;
}
第16题:
对于数组int[][]t={{1,2,3},{4,5,6}}来说,t.length等于3,t[0].length等于2。( )
第17题:
In order to acquire a second language, learners will subconsciously use their first language knowledge in learning a second language. This is know as language t().
transfer
略
第18题:
现有元组valt=(1,3.14,"Fred"),关于元组t的说法错误的是?()
第19题:
public class Bootchy { int bootch; String snootch; public Bootchy() { this(”snootchy”); System.out.print(”first “); } public Bootchy(String snootch) { this(420, “snootchy”); System.out.print(”second “); } public Bootchy(int bootch, String snootch) { this.bootch = bootch; this.snootch = snootch; System.out.print(”third “); } public static void main(String[] args) { Bootchy b = new Bootchy(); System.out.print(b.snootch +“ “ + b.bootch); } } What is the result?()
第20题:
StringBuffer append(数值类型 t),参数t可以是boolean、int、char、float、double、long
第21题:
Public class Holt extends Thread{ Private String sThreadName; Public static void main(String argv[]) { Holt h=new Holt(); h.go(); Holt(){}; Holt(String s){ sThreadName=s; Public String getThreadName() { return sThreadName;} } Public void go(){ Hot first=new Hot("first"); first.start(); Hot second=new Hot("second"); second.start(); } Public void start() { For(int i=0;i<2;i++) { System.out.print(getThreadName()+i); Try{ Thread.sleep(100); }catch(Exception e){ System.out.print(e.getMessage()) ; } } } } 当编译运行上面代码时,将会出现()
第22题:
x==(int)(double)x
x==(int)(float)x
d==(double)(float)d
(f+d)-f==d
第23题:
snootchy 420 third second first
snootchy 420 first second third
first second third snootchy 420
third second first siiootchy 420
third first second snootchy 420
first second first third snootchy 420