What will be printed out as a result of the following code execution? (C++11)
#include <iostream>
#include <vector>
using namespace std;

void f(const vector<int>& v)
{
    for(auto i: v)
        i=0;
}

int main()
{
    vector<int> v{1,1};
    for(int i=0; i!=5; ++i)
        v.push_back(v[v.size() - 1] + v[v.size() - 2]);
    f(v);
    for(auto i: v)
        cout << i << ' ';
}

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести