template<class t1>
void linkstack<t1>::push(t1 &x)
{stacknode<t1> *p;
if(top)
{p=new stacknode<t1>;
assert(p);
p->data=x;
p->next=top;
top=p;
}
else
{top=new stacknode<t1>;
assert(top);
top->data=x;
top->next=NULL;
}
height++;}
//出栈函数
template<class t1>
bool linkstack<t1>::pop(t1&x)
{stacknode<t1> *p;
if(height)
{x=top->data;
p=top;
top=top->next;
delete p;
height--;
return true;}
else
return false;}
int main()
{int i,j=0,x;
linkstack<int> a,b,c;
cout<<"请输入要输入整数的个数"<<endl;
cin>>i;
cout<<"请输入整数"<<endl;
while(j<i)
{cin>>x;
if(x<60)a.push(x);
if(60<=x&&x<100)b.push(x);
if(x>100)c.push(x);
j++;}
cout<<"小于60的整数"<<endl;