阅读下列说明和C++程序,将应填入(n)处的字句写在对应栏内。【程序1说明】 程序

题型:问答题

问题:


阅读下列说明和C++程序,将应填入(n)处的字句写在对应栏内。
【程序1说明】
程序1中定义了数组的类模板,该模板使得对于任意类型的二维数组,可以在访问数组元素的同时,对行下标和列下标进行越界判断,并给出相应的提示信息(C++语言本身不提供对下标越界的判断)。
【程序1】
#include < iostream. h >
template < class T > class Array2D;
template < class T > class Array2DBody {
friend (1) ;
T * tempBody;
int iRows, iColumns, iCurrentRow;
Array2DBody(int Rows,int Cols) {
tempBody = (2) ;
iRows = Rows;
iColumns = Cols;
iCurrentRow = -1;
}
public:
T& operator[ ] (int j){
bool row_ error, column_ error;
row_ error = column_ error = false;
try {
if ( iCurrentRow < 0||iCurrentRow > = iRows)
row_ error = true;
if( j < 0||j > = iColumns)
column_error = true;
if( row_error = = true [ [ column_ error = = true)
(3) ;
}
catch(char) {
if (row_error = = true)
cerr < < "行下标越界"[" < < iCurrentRow < < "]";
if( colmnn_error = = true)
cerr< <"列下标越界[" < <j< <"]";
cout < < "\n";
}
return tempBody[ iCurrentRow * iColumns + j ];
}
~ Array2 DBody ( ) { delete [ ] tempBody; } }; template < class T > class Array2D {
Array2DBody < T > tBody;
public:
Array2DBody < T > & operalor[ ] (int i) {
tBody, iCurreutRow = i;
(4) ;
Array2D(int Rows,int Cols): (5) {} };
void main( )
{
Array2D <int> al ( 10,20 );
Array2D <double> a2(3,5);
int bl;
double b2;
b1=a1[-5][10];//有越界提示:行下标越界[-5]
b1=a1[10][15];//有越界提示:行下标越界[10]
b1=a1[1][4];//没有越界提示
b2=a2[2][6];//有越界提示:列下标越界[6]
b2=a2[10][20];//有越界提示:行下标越界[10]列下标越界[20]
b2=a2[1][4];//没有越界提示
}

考点:计算机软件水平考试初级程序员程序员
题型:问答题

经济增长可通过()来实现。

A.各种要素投入的增加方式

B.要素生产率的提高方式

C.各种要素投入的增加和要素生产率的提高两种方式

D.各种要素投入的增加和集约经营两种方式

题型:问答题

女,60岁,右颈淋巴结肿大3个月,蚕豆大小,其可能性最小的病变是

A.淋巴结反应性增生
B.转移癌
C.淋巴结结核
D.转移性肉瘤
E.恶性淋巴瘤

题型:问答题

患儿男,7岁。1天来寒战,高热(T39.8℃),烦躁不安,右膝下方剧痛,膝关节呈半屈曲状,拒动。查体:右小腿近端皮温尚可,压痛阳性。

最可能的诊断是()

A.风湿性关节炎

B.化脓性关节炎

C.化脓性骨髓炎

D.创伤性关节炎

E.类风湿关节炎

题型:问答题

秘书写作有哪些原则?

题型:问答题

患者肝功能减退时,可以正常应用,但需谨慎,必要时减量给药的药物不包括()

A.红霉素

B.氯霉素

C.阿奇霉素

D.林可霉素

E.克林霉素

更多题库