下列选项中,能填入空白处2的代码是()
A: index = rd.nextInt();
B: index = rd.nextInt(5);
C: index = rd.nextInt(len + 1);
D: index = rd.nextInt(len);
A: index = rd.nextInt();
B: index = rd.nextInt(5);
C: index = rd.nextInt(len + 1);
D: index = rd.nextInt(len);
举一反三
- 下列选项中,能填入空白处4的代码是() A: chs[i] = letters[index]; B: chs[i] = letters[i]; C: chs[index] = letters[i]; D: chs[index] = letters[index];
- 下列哪些代码段能生成一个1—100之间的随机数? A: new Random().nextInt(101) B: new Random().nextInt(100) C: new Random().nextInt(100)+1 D: (int)(Math.random()*100)
- 下列选项中,能填入空白处3的代码是() A: !flags[index] B: !flags[i] C: flags[index] D: flags[i]
- 下列选项中,能填入空白处5的代码是() A: flags[i] = true; B: flags[i] = false; C: flags[index] = true; D: flags[index] = false;
- 当输入为 ‘cbabc’ 时,下列程序的输出结果为?s1 = raw_input() index = 0 s2 = '' while index [ len(s1) - 1: if s1[index] ] s1[index + 1]: s2 += s1[index] else: s2 = s2 * 2 index += 1 print s2