#include <iostream> #include <list> int main() { std::list<int> numbers = {1, 2, 3, 4, 5}; std::cout << "قبل از pop_back: "; for (int num : numbers) std::cout << num << " "; numbers.pop_back(); // حذف آخرین عنصر (5) std::cout << "\nبعد از pop_back: "; for (int num : numbers) std::cout << num << " "; return 0; }