#include using namespace std; const int SIZE = 100; template void swap(T* a, T* b) {  T* t;  t = a; a = b; b = t; } template class Array { private:  Type a[SIZE];  int length; public:  Array(Type* b, int n);  void print() {   for (int i = 0; i < length; i++) {    cout << a[i]<<" ";   }   cout << endl;  }  void sort();  void reverse();  int find(Type t);  Type &sum(); }; template Array::Array(Type* b, int n) {  if (n > SIZE)  {   cout << "数组太大!" << endl;   exit(1);  }  length = n;  for (int i = 0; i < n; i++)   a[i] = b[i]; } template void Array::sort() {  for (int i = 0; i < length - 1; i++)   for (int j = i; j < length; j++)    if (a[j] < a[i]) swap(a[i], a[j]); } template void Array::reverse() {  for (int i = 0; i < length / 2; i++) {   swap(a[i], a[length - 1 - i]);  } } template int Array::find(Type x) {  for (int i = 0; i < length; i++)   if (x == a[i])    return i + 1; } template Type &Array::sum() {  Type s=a[0];  for (int i = 1; i < length; i++)   s = s + a[i];  return s; } int main() {  int a[] = {1,2,5,4,3};  double b[] = {10.0,8.0,7.0,9.0,6.0};  Array A(a, 5);  Array B(b, 5);  A.sort(); B.sort();  A.print(); B.print();  A.reverse(); B.reverse();  A.print(); B.print();  cout<