//list容器應用 #include#include using namespace std; int main() { list
lst; lst.push_back(1); lst.push_back(2); lst.push_back(3); lst.push_back(4); list ::iterator iter; cout<<"從表頭到表尾:"; for(iter=lst.begin();iter!=lst.end();iter++) cout<<*iter<<" "; cout< ::reverse_iterator iter1; cout<<"從表尾到表頭:"; for(iter1=lst.rbegin();iter1!=lst.rend();iter1++) cout<<*iter1<<" "; cout<