#include <iostream>
void double_it(int& val)
{
val *= 2;
}
void print_it(int val)
{
std::cout << val << '\n';
}
int main()
{
int values[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
for (auto value : values)
print_it(value);
std::cout << '\n';
for (auto& value : values)
double_it(value);
for (auto value : values)
print_it(value);
std::cout << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCBkb3VibGVfaXQoaW50JiB2YWwpCnsKICAgIHZhbCAqPSAyOwp9Cgp2b2lkIHByaW50X2l0KGludCB2YWwpCnsKICAgIHN0ZDo6Y291dCA8PCB2YWwgPDwgJ1xuJzsKfQoKaW50IG1haW4oKQp7CiAgICBpbnQgdmFsdWVzWzEwXSA9IHsgMSwgMiwgMywgNCwgNSwgNiwgNywgOCwgOSwgMTAgfTsKCiAgICBmb3IgKGF1dG8gdmFsdWUgOiB2YWx1ZXMpCiAgICAgICAgcHJpbnRfaXQodmFsdWUpOwogICAgc3RkOjpjb3V0IDw8ICdcbic7CgogICAgZm9yIChhdXRvJiB2YWx1ZSA6IHZhbHVlcykKICAgICAgICBkb3VibGVfaXQodmFsdWUpOwoKICAgIGZvciAoYXV0byB2YWx1ZSA6IHZhbHVlcykKICAgICAgICBwcmludF9pdCh2YWx1ZSk7CiAgICBzdGQ6OmNvdXQgPDwgJ1xuJzsKfQ==