题目:反序链表
程序:
#include<iostream>
#include<list>
#include<stack>
using namespace std;
int main()
{
cout<<"enter the list";
int tem;
stack<int> sta;
list<int> lis;
if(cin>>tem)
while(cin>>tem)
{
sta.push(tem);
cout<<"enter the list";
}
else cout<<"empty"<<endl;
int top;
while(!sta.empty())
{
top=sta.top();
lis.push_back(top);
cout<<top;
sta.pop();
}
return 0;
}
白痴级