MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;} %>
MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { . MY_ARRAY[${i}] = ’${serverArray[i]}’;. } %>
MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;. <% } %>
MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[${i}] = ’${serverArray[i]}’;. <% } %>
第1题:
阅读以下函数说明和C语言函数,将应填入(n)处的字句写在对应栏内。
【说明】
实现矩阵(3行3列)的转置(即行列互换)。
例如,输入下面的矩阵:
100 200 300
400 500 600
700 800 900
程序输出:
100 400 700
200 500 800
300 600 900
【函数】
int fun(int array[3][3])
{
int i,j,t;
for(i=0;(1);i++)
for(j=0;(2);j++)
{
t=array[i][j];
(3);
(4);
}
}
}
main()
{
int i,j;
int array[3][3]={{100,200,300},{400,500,600},{700,800,900}};
clrscr();
for (i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%7d",array[i][j]);
printf("\n");
}
fun((5));
printf("Converted array:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%7d",array[i][j]);
printf("\n");
}
}
第2题:
You are writing a method to compress an array of bytes.The array is passed to the method in a parameter named document.You need to compress the incoming array of bytes and return the result as an array of bytes.Which code segment should you use?()
A.
B.
C.
D.
第3题:
A.将1,2,3,4,5输出到屏幕
B.将0,1,2,3,4输出到屏幕
C.将0,1,2,3,4,5输出到屏幕
D.将出现运行时异常
第4题:
int [] my_Array; My_Array=new int [5]; For(int count = 0 ; count <=5; count ++) System.out.pringtln(my_Array[count]); 以上Java代码运行的结果是()
第5题:
A.static final int[]a={100,200};
B.static final int[]a;static{a=new int[2];a[0]=100;a[1]=200;}
C.static final int[]a=new int[2]{100,200};
D.static final int[]a;static void int(){a=new int[3];a[0]=100;a[1]=200;}
第6题:
#include <stdio.h>void main(){ void sort(int array[],int n); int a[10],i; printf("enter the array:\n"); for(i=0;i<10;i++) scanf("%d",&a[i]); sort(a,10); printf("The sorted array:\n"); for(i=0;i<10;i++) printf("%d",a[i]); printf("\n");}void sort(int array[],int n){ int i,j,k,t; for(i=0;i<n-1;i++) { k=i; for(j=i+1;j<n;j++) if(array[j]<array[k]) k=j; t=array[k];array[k]=array[i];array[i]=t; }}程序呢,就是这个了。谭老爷子书上的例题,和书上一样,然后输入:5 7 -3 21 -43 67 321 33 51 0 然后从小到大排好后输出,书上他们之间从小到大有间隔,但是我运行了,没有间隔。。。。( ⊙o⊙ )?咋解决?????来高手解答。。。我运行后是:-43-305721335167321
第7题:
有以下程序: #include <iostream> #include <cstdlib> using namespace std; int main() { int arraysize; int *array; cout<<"Please input the size of the array:"; cin>>arraySiZe; array=new int[arraysize]; if(array==NULL) { cout<<"allocate Error\n"; exit(1); } for(int i=0;i<arraysize;i++) array[i]=i*i; int j; cout<<"which element you want to check:"; cin>>j; cout<<array[j]<<end1; return 0; } 执行程序输入:10<空格>5,则输出结果为( )。
A.allocate Error
B.1
C.0
D.25
第8题:
A.将1,2,3,4,5输出到屏幕
B.将0,1,2,3,4输出到屏幕
C.将0,1,2,3,4,5输出到屏幕
D.将出现运行时异常
第9题:
下列程序用于打印出ASCⅡ字符,其析构函数内的语句应为【 】。
include<iostream. h>
inelude<iomanip, h>
template<class T>
class Array
{
T * elems;
int size;
public:
Array(int.s);
~Array()
T& operator[](int)
void perator=(T)
};
template<class T>
Array<T>::Array(int s)
size=s;
elems=new T[size]
for(int i=0;i<size;i++)
elems[i]=0
}
template<celass T>
Array<T>::~Array()
{
______
template <class T>
T& Array<T>::operator[](int index)
{
return elems[index];
}
template<class T>
void Array<T>::operator=(T temp)
{
for(int i=0;i<size;i++)
elems[i]=temp;
}
void main()
{
int i,n=26;
Array<int> arr1(n)
Array<char> arr2(n)
for(i=0;i<n;i++)
{ -.
arr1[i]='a'+i;
arr2[i]='a'+i;
}
cout<<"ASCII 字符"<<endl;
for(i=0;i<n;i++)
cout<<setw(8)<<arr1[i]<<setw(8)<<arr2[i]<<endl;
}
第10题:
int [] my_Array; my_Array = new int[5]; for(int count = 0; count <= 5; count++) System.out.println(my_Array[count]); 结果是()