A. that
B. which
C. what
D. whichever
第1题:
I ()have been here, but I()not find the time.
A. could; could
B. might; could
C. should; could
D. should; would
第2题:
第3题:
28、下列代码的输出结果是()。 function sum(x: number, ...rest: number[]): number { let result = x; for (let i = 0; i < rest.length; i++) { result += rest[i]; } return result; } console.log(sum(1, 2, 3, 4, 5));
A.运行错误
B.运行正确,结果为5
C.运行正确,结果为10
D.运行正确,结果为15
第4题:
第5题:
下面的代码用于输出字符数组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); }
第6题:
8、下列代码的输出结果是()。 function sum(x: number, ...rest: number[]): number { let result = x; for (let i = 0; i < rest.length; i++) { result += rest[i]; } return result; } console.log(sum(1, 2, 3, 4, 5));
A.运行错误
B.运行正确,结果为5
C.运行正确,结果为10
D.运行正确,结果为15