<?php $A=array_fill(-5,3,"Hello"); for ($i=0; $i<5; $i++){ echo "\$A[$i] = ".$A[$i]." "; } ?>以下程序运行结果为( )。
A: $A[0] = Hello $A[1] = Hello $A[2] = $A[3] = $A[4] =
B: $A[0] = Hello $A[1] = Hello $A[2] = Hello $A[3] = $A[4] =
C: $A[0] = $A[1] = $A[2] = $A[3] = $A[4] =
D: 程序运行提示错误
A: $A[0] = Hello $A[1] = Hello $A[2] = $A[3] = $A[4] =
B: $A[0] = Hello $A[1] = Hello $A[2] = Hello $A[3] = $A[4] =
C: $A[0] = $A[1] = $A[2] = $A[3] = $A[4] =
D: 程序运行提示错误
举一反三
- 【单选题】以下程序运行结果为()。 <?php $A=array_fill(-5,3,"Hello"); for ($i=0; $i<5; $i++){ echo "$A[$i] = ".$A[$i]." "; } ?> A. $A[0] = Hello $A[1] = Hello $A[2] = $A[3] = $A[4] = B. $A[0] = Hello $A[1] = Hello $A[2] = Hello $A[3] = $A[4] = C. $A[0] = $A[1] = $A[2] = $A[3] = $A[4] = D. 程序运行提示错误
- 以下程序运行结果为()。 A: $A[0]=Hello$A[1]=Hello$A[2]=$A[3]=$A[4]= B: $A[0]=Hello$A[1]=Hello$A[2]=Hello$A[3]= $A[4]= C: $A[0]=$A[1]=$A[2]= $A[3]= $A[4]= D: 程序运行提示错误
- 有以下程序: main() { int a[3][3], *p, i; p=&a[0][0]; for(i=0; i<9; 1++)p[i]=i; for(i=0; i<3; i++)printf("% d", a[1][i]); 程序运行后的输出结果是______。[/i][/i] A: 0 1 2 B: 1 2 3 C: 2 3 4 D: 3 4 5
- 下面程序运行后,输出结果是( )。#include ;main( ){ int a[10]={1,2,3,4,5,6},i,j; for(i=0;i { j=a[i];a[i]=a[5-i];a[5-i]=j;} for(i=0;i}[/i][/i] A: 1 5 4 3 2 6 B: 1 5 3 4 2 6 C: 6 5 4 3 2 1 D: 1 2 3 4 5 6
- 下列代码段执行后的结果是()int[] a = { 1, 3, 5, 2, 4 };int j = 4;for (int i = 0; i <; 5; i++) { a[i] = a[j]; j--;}for (int i = 0; i <; 5; i++) System.out.print(a[i] + " ");[/i][/i] A: 1 2 3 4 5 B: 5 4 3 2 1 C: 4 2 5 2 4 D: 4 2 5 3 1