#include <iomanip>
#include <iostream>
#include <list>
#include <random>
using namespace std;
int main() {
uniform_int_distribution<size_t> cnt(5, 10);
uniform_int_distribution<> uid(10, 99);
mt19937 gen{ random_device()() };
const auto count = cnt(gen) << 1;
list<int> nums;
for (size_t i = 0; i < count; ++i) nums.push_back(uid(gen));
list<int> sums;
auto it = nums.begin();
while (it != nums.end()) {
auto sum = *it;
it = next(it);
sum += *it;
sums.push_back(sum);
++it;
}
for (auto num : nums) cout << num << ' ';
cout.put('\n');
cout << setw(5);
for (auto sum : sums) cout << sum << setw(6);
cout.put('\n');
cin.get();
}