#include <iostream.h>
#include <string>
using namespace std;
struct Student
{
int age;
};
template<typename T>
class MyStudent
{
public:
Student A[10];
MyStudent(void);
InsertionSort(T A[],int n);
int GetElem(void);
};
template<typename T> MyStudent<T>::MyStudent()
{}
template<typename T> MyStudent<T>::InsertionSort(T A[],int n)
{
int i,j;
T temp;
for(i=1;i<n;i++)
{
j=i;
temp.age=A[i].age;
while(j>0&&temp.age<A[j-1].age)
{
A[j].age=A[j-1].age;
j--;
}
A[j].age=temp.age;
}
}
template<typename T> int MyStudent<T>::GetElem(void)
{
}
main()
{
}

被折叠的 条评论
为什么被折叠?



