【单选题】在Java语言中,经过如下运算后,num的值为()int num = 0;num = 2>;3?0:1;
A: 0
B: 1
C: 2
D: 3
A: 0
B: 1
C: 2
D: 3
举一反三
- 在C#语言中,经过如下运算后,num的值为(选一项)int num = 0;num = 2>3?0:1;
- 中国大学MOOC: 执行如下代码片段后,num的值为:int num = 5;num = (num % 2) == 0 ? num – 1 : num + 1;
- 执行如下代码片段后,num的值为:int num = 5;num = (num % 2) == 0 ? num – 1 : num + 1; A: 1 B: 4 C: 5 D: 6
- 下列程序的输出结果是() num = 27 count = 0 while num > 0: if num % 2 == 0: num /=2 elif num % 3 ==0: num /= 3 else: num -=1 count += 1 print (count)
- 哪行代码会导致错误?()num=[5,4,3,[2],1]print(num[0])print(num[3][0])print(num[5])