公安机关
武警部队
国家移民管理部门
外事部门
第1题:
阅读以下程序说明和C++程序,将程序段中(1)~(5)空缺处的语句填写完整。
[说明]
C++语言本身不提供对数组下标越界的判断。为了解决这一问题,在以下[C++程序]中定义了相应的类模板,使得对于任意类型的二维数组,可以在访问数组元素的同时,对行下标和列下标进行越界判断,并给出相应的提示信息。
[C++程序]
include <iostream.h>
template <class T> class Array;
template <Class T> class ArrayBody {
friend (1);
T* tpBody;
int iRows,iColumns, iCurrentRow;
ArrayBody(int IRsz, int iCsz) {
tpBody =(2);
iRows = iRsz;
iColumns = iCsz;
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 (column_error = true)
cerr << "列下标越界[" << j << "]";
cout << "\n";
}
return tpBody[iCurrentRow * iColumns + j];
}
~Arraygody(){delete[]tpBody;}
};
template <class T> class Array {
ArrayBody<T> tBody;
Public;
ArrayBody<T> & operator[] (int i) {
(4);
return tBody;
}
Array(int iRsz, int iCsz) :(5) { }
};
void main()
{
Array<int> a1(10,20);
Array<double> a2(3,5);
int b1;
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]; //没有越界提示
}
第2题:
界江水域由中朝两国共管共用,双方人员不登上对方江岸不属越界。()
第3题:
越界采矿行为
第4题:
无证勘查、越界勘查的应承担什么责任?
第5题:
家长越界行为有哪些?()
第6题:
虽有非法出入境的行为,但不以非法出入境犯罪论处的有()。
第7题:
中朝边界界江水域由中朝两国共管共用,双方人员不登上对方江岸不属越界。
第8题:
对
错
第9题:
在C#中,编译时对数组下标越界将作检查
在C#中,程序运行时,数组下标越界也不会产生异常
在C#中,程序运行时,数组下标越界是否产生异常由用户确定
在C#中,程序运行时,数组下标越界一定会产生异常
第10题:
RuntimeException
IOException
ArrayIndexOutOfBoondException
classCastException
第11题:
第12题:
NullpointerException
ArithmeticExceptioin
ArrayIndexOutOfBoundsException
SecurityManager
第13题:
阅读下列C++程序和程序说明,将应填入(n)处的字句写在对应栏内。
【说明】
C++语言本身不提供对数组下标越界的判断。为了解决这一问题,在程序6中定义了相应的类模板,使得对厂任意类型的二维数组,可以在访问数组元素的同时,对行下标和列下标进行越界判断,并给出相应的提示信息。
include<iostream.h>
template <class T> class Array;
template <class T> class ArrayBody {
friend (1)
T* tpBody;
int iRows, iColumns, iCurrentRow;
ArrayBody (int iRsz, int iCsz) {
tpBody =(2)
iRows = iRsz; iColumns =iCsz; 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 (column_error== true )
cerr << "列下标越界[" <<j << "]";
cout << "\n";
}
return tpBody[iCurrentRow * iColumns +j];
};
~ArrayBody ( ) { delete[] tpBody; }
};
template <class T> class Array {
ArrayBody<T> tBody;
public:
ArrayBody<T> & operator[] (int i) {
(4)
return tBody;
}
Array (int iRsz, int iCsz) :(5) {}
};
void main()
{ Array<int>a1(10,20);
Array<double>a2(3,5);
int b1;
double b2;
b1=a1[-5][10]; //有越界提示:行下标越界[-5]
b1=a1[10][15]; //有越界提示:行下标越界[10]
b1=a1[1][4]; //没有越界提示
b2=a2[2][6]; //有越界提示:列下标越界[6]
b2=s2[10][20]; //有越界提示:行下标越界[10]列下标越界[20]
b2=a2[1][4]; //没有越界提示
}
第14题:
出租汽车GPS调度系统中()功能是带有语音播报的。
第15题:
《七条规定》中“必须在批准区域正规开采,严禁超层越界或者巷道式采煤、空顶作业”,其中超层越界开采是指哪几种情形?
第16题:
越界采矿行为承担什么法律责任?
第17题:
下列说法正确的是()
第18题:
牲畜越界后,不可越界追赶,应通过向对方索要。()
第19题:
严禁进入边境禁区或在边界地带开枪打猎,禁止向对方境内射击和越界追捕飞禽走兽,严禁捕猎国家规定或双方协议规定的保护动物。
第20题:
对
错
第21题:
第22题:
语言越界
行动越界
心理越界
沟通越界
第23题:
走私毒品
越界狩猎
越界捕鱼
越界砍伐木材