A、will
B、would
C、might
第1题:
此题为判断题(对,错)。
第2题:
A.for(inti=0;i<a.size();i++) System.out.println(a.get(i)));
B.for(inti=0;i<a.size();i++) System.out.println(a[i]);
C.while(iter.hasNext()) System.out.println(iter.next());
D.for(inti=0,i<a.size();i++) System.out.println(iter[i]);
E.for(inti=0;i<a.size();i++) System.out.println(iter.get(i));
第3题:
B)阅读短文,然后从短文括号中所给词的适当形式填空。
Climbingthehighestmountainsintheworldisnotan78(easily)job.Youhavetofightbadweather,illnessandfear.ButJordanRomero,athirteen-year-oldboyfromAmerica,willclimb79(Asia)highestmountain,MountQomolangma.Hewillsetoutthismonth.80(He)parentsandhelperswillclimbwithhim.Heplanstotake81(second)monthsforhisclimb.“I'mready.ButifIdon'treachthetop82(successful),I'lltrynexttime,”hesaid.Jordanhasalreadyclimbedthehighestmountainsofsixothercontinents(洲).Ifhe83(get)tothetopthistime,hewillbecometheyoungestpersontoclimbtheworld'shighestmountain.
78_________
第4题:
使用VC6打开考生文件夹下的工程test37_1,此工程包含一个源程序文件test37_1.cpp,但该程序运行有问题,请改正函数中的错误,使该程序的输出结果为:
0149 16 25 36 49 64 81
源程序文件test37_1.cpp清单如下:
include<iostream.h>
template <class T, int N = 100> class Vector
{
T vec[N];
public:
void set(int pos, T val);
T get(iht pos);
/***************** found *****************/
}
template <class T, int N> void Vector<T, N>::set(int pos, T val)
{
vec[pos] = val;
}
/***************** found *****************/
template <class T, int N> Vector<T, N>::get(int pos)
{
return vec[pos];
}
int main ()
{
Vector<double, 10> v;
int i = 0;
double d = 0.0;
for (i = 0; i < 10; i++)
v.set(i, double(i * i));
for (i = 0; i < 10; i++)
cout<<v.get(i)<<" ";
cout<<end1;
/***************** found *****************/
}
第5题:
下面程序输出的结果是( )。 #include<iostream> using namespace std; void main() { char ch[][8]={"good","better","best"}; for(int i=1;i<3;++i) { cout<<ch[i]<<endl; } }
A.good better
B.better best
C.good best
D.good
第6题:
下面的代码用于输出字符数组ch中每个字符出现的次数,应该填入的代码是()public static void main(String[] args) { char[] ch = { 'a', 'c', 'a', 'b', 'c', 'b' }; HashMap map = new HashMap(); for (int i = 0; i < ch.length; i++) { < 填入代码 > } System.out.println(map); }
A.if (map.contains(ch[i])) { map.put(ch[i], map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }
B.if (map.contains(ch[i])) { map.put(ch[i], (Integer) map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }
C.if (map.containsKey(ch[i])) { map.put(ch[i], (int) map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }
D.if (map.containsKey(ch[i])) { map.put(ch[i], (Integer) map.get(ch[i]) + 1); } else { map.put(ch[i], 1); }