#include <iostream>
#include <random>
#include <vector>
#include <functional>
#include <algorithm>
using namespace std;
int main() {
vector<int> tab(99);
int sum = 0;
random_device rd;
auto rand = bind(uniform_int_distribution<>(4, 10), mt19937(rd()));
generate(tab.begin(), tab.end(), rand);
for_each(tab.cbegin(), tab.cend(), [&sum](int num) { sum += num; cout << num << "\n"; });
cout << "Suma: " << sum << "\n";
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8cmFuZG9tPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KI2luY2x1ZGUgPGFsZ29yaXRobT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCXZlY3RvcjxpbnQ+IHRhYig5OSk7CglpbnQgc3VtID0gMDsKCglyYW5kb21fZGV2aWNlIHJkOwogICAgYXV0byByYW5kID0gYmluZCh1bmlmb3JtX2ludF9kaXN0cmlidXRpb248Pig0LCAxMCksIG10MTk5MzcocmQoKSkpOwoKCWdlbmVyYXRlKHRhYi5iZWdpbigpLCB0YWIuZW5kKCksIHJhbmQpOwoJZm9yX2VhY2godGFiLmNiZWdpbigpLCB0YWIuY2VuZCgpLCBbJnN1bV0oaW50IG51bSkgeyBzdW0gKz0gbnVtOyBjb3V0IDw8IG51bSA8PCAiXG4iOyB9KTsKCWNvdXQgPDwgIlN1bWE6ICIgPDwgc3VtIDw8ICJcbiI7Cn0=