有下列程序:voidsum(inta[]){a[0]=a[-1]+a[1];}main(){inta[10]={1,2,3,4,5,6,7,8,9,10};sum(&a[2]);printf("%d\n",a[2]);}程序运行后的输出结果是()
举一反三
- 当执行下面的语句定义一维数组a后,此数组的所有元素为 ( ) inta[10]; A.a[1],a[2],a[3],a[4],a[5],a[6],a[8],a[9],a[10],a[10] B.a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9] C.a[0],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10] D.a[1],a[2],a [3],a[4],a [5],a [9],a [7],a [8],a [9],a [10],a [11]
- 有下列程序:inta=4;intf(intn){intt=0;staticinta=5;if(n%2){inta=6;t+=a++;}else{inta=7;t+=a++;}returnt+a++;}main(){ints=a,i=0;for(;i<2;i++)s+=f(i);printf("%d\n",s);}程序运行后的输出结果是()
- >>>x= [10, 6, 0, 1, 7, 4, 3, 2, 8, 5, 9]>>>print(x.sort()) 语句运行结果正确的是( )。 A: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] B: [10, 6, 0, 1, 7, 4, 3, 2, 8, 5, 9] C: [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0] D: ['2', '4', '0', '6', '10', '7', '8', '3', '9', '1', '5']
- 以下程序的输出结果是___________。for i in range(1,11): print(i, end = " ") A: 1 2 3 4 5 6 7 8 9 B: 1 2 3 4 5 6 7 8 9 10 C: 1 2 3 4 5 D: 1 3 5 7 9
- 下面语句的输出结果是?range(len('HelloWorld')) A: [1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11] B: 11 C: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] D: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]