#include <iostream>
#include <string>
#include <vector>
int main()
{
typedef std::vector<std::string> vec_type;
vec_type v = { "test", "tester", "tester" };
vec_type::iterator it = v.begin();
while (it != v.end())
{
const std::string& s = *it;
if (++it == v.end())
std::cout << "LAST: " << s << '\n';
else
std::cout << s << '\n';
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgoKaW50IG1haW4oKQp7CiAgICB0eXBlZGVmIHN0ZDo6dmVjdG9yPHN0ZDo6c3RyaW5nPiB2ZWNfdHlwZTsKICAgIHZlY190eXBlIHYgPSB7ICJ0ZXN0IiwgInRlc3RlciIsICJ0ZXN0ZXIiIH07CgogICAgdmVjX3R5cGU6Oml0ZXJhdG9yIGl0ID0gdi5iZWdpbigpOwogICAgd2hpbGUgKGl0ICE9IHYuZW5kKCkpCiAgICB7CiAgICAgICAgY29uc3Qgc3RkOjpzdHJpbmcmIHMgPSAqaXQ7CgogICAgICAgIGlmICgrK2l0ID09IHYuZW5kKCkpCiAgICAgICAgICAgIHN0ZDo6Y291dCA8PCAiTEFTVDogIiA8PCBzIDw8ICdcbic7CiAgICAgICAgZWxzZQogICAgICAgICAgICBzdGQ6OmNvdXQgPDwgcyA8PCAnXG4nOwogICAgfQp9