list<int> l; for(int i = 0; i<10; i++) { l.push_back(i); }
for(list<int>::reverse_iterator it = l.rbegin(); it != l.rend();) { cout<<*it<<endl; it = list<int>::reverse_iterator(l.erase((++it).base())); }
Powered by: 博客园 Copyright © 2024 月光林地 Powered by .NET 9.0 on Kubernetes