题目内容

请使用“答题”菜单或使用VC6打开考生文件夹proj2下的工程proj2。此工程包含一个程序文件main.cpp,其中的Array是一个表示数组的模板类。Array的成员a用于指向存放数据的数组,size表示该数组的大小。此程序的输出结果应为: 8 29,20,33,12,18,66,25,14 66,33 注意:只能在画线处填写适当的代码,不要改动程序中的其他内容,也不能删除或移动//************found************。 //源程序 #include <iostream> #include <cstdlib> using namespace std; template<class Type> class Array//数组类 Type *a; int size; public:

Array(Type b[],int mm):size(mm)//构造函数
B. if(size<2) cout<<"数组长度太小,退出运行!\n";exit(1);
C. //************found************
D. a=______;//a指向申请的数组空间
E. for(int i=0; i<size; i++) a[i]=b[i];//************found************
F. ~Array()______; //析构函数
G. void MaxTwo(Type& x1,Type& x2) const;//由x1和x2带回数组a中的两个最大值
H. //************found************
I. int Length() const______;//返回数组长度
J. Type operator[](int i) const
K. //下标运算符重载成员函数
L. if(i<0 || i>=size)cout<<"下标越界!"<<endl;exit(1);
M. return a[i];;
N. //由x1和x2带回数组a中的两个最大值
O. template<class Type>
P. void Array<Type>::MaxTwo(Type& x1,Type& x2) const //补充完整函数体的内容
Q. //将数组a中头两个数据赋值给x1和x2,使得x1>=x2
R. //************found************
S. ______(x1=a[0],x2=a[1]):(x1=a[1],x2=a[0]);
T. for(int i=2;i<size; i++)
U. if(a[i]>x1)x2=x1; x1=a[i];
V. else if(a[i]>x2) x2=a[i];
W. void main()
X. int s1[8]=29,20,33,12,18,66,25,14;Array<int> d1(s1,8);
Y. int i,a,b;
Z. d1.M axTwo(a,b);
[. cout<<d1.Length()<<endl;
\. for(i=0;i<7;i++) cout<<d1[i]<<",";
]. cout<<d1[7]<<endl;cout<<a<<","<<b<<endl;

查看答案
更多问题

孙嘉就读于市某重点高中,今年已经高三了,在最近一次模拟大考中由于发挥失常成绩不佳,因此遭到父母的责备,并整天抱怨他不争气,再这样下去上大学是没有指望了。父母的责备让孙嘉感到很痛心,情绪非常低落,渐渐地出现了厌学情绪,导致他成绩不断下滑。父母知道此情况后对他更是百般责备,而孙嘉甚至对父母产生了憎恨,总是说“我恨他们”。孙嘉的班主任了解到此情况后,找到社会工作者小关,孙嘉见到小关的第一句话还是“我恨他们”。小关耐心地问道:“你指的他们是谁呢是你的父母吗”“你是因为他们总在你成绩不理想的时候责骂你而难过,是吗”小关使用的技巧属于个案会谈技巧中的( )。

A. 支持性
B. 影响性
C. 倡导性
D. 引领性

简答题 简述财务经理的主要职责。

简答题 在经营类型分析中,划分报社经营类型的判别准则是什么。

Shanghai is the largest city in China. About eleven million people make their homes in Shanghai and its suburbs (郊区). This enormous (巨大的) city spreads out along the banks of the Hoang Pu River, which flows into the mouth of the Yangtze River about fourteen miles north of here. Large oceangoing ships travel to Shanghai by way of the Yangtze and the Huang Pu. Shanghai was a small, unimportant city until 1842 when China lost a war with Great Britain. Tile British realized that Shanghai was in an excellent location(位置) to serve as a seaport for the densely(密集) populated Yangtze River Plain. They forced the Chinese to allow English traders to settle on the wastelands outside the city walls. Later, French, American, and Japanese traders also came to Shanghai. The foreigners built whole new sections of Shanghai, including homes, stores, factories, and office buildings. Thousands of Chinese poured into Shanghai in search of jobs. Most of them settled in the old part of the city. As time passed, shanghai became one of the busiest seaports in the world.

A. Which of the following countries does first settle on wastelands outside the city walls A) Japan. C ) English. B) America. D) French.

答案查题题库