#include <vector> int func(std::vector<int> vec) { static int k = 2; std::vector<int>::reverse_iterator it; for(it = vec.rbegin(); it != vec.rend(); ++it) { k += *it % 2 == 0 ? ++*it : (*it)++; } return k; } int main() { ...