#include<iostream>
#include<string>
#include<vector>
using std::vector;
using std::string;
using std::cout;
using std::endl;
using std::cin;
int main()
{
vector<int> a;
int num = 0;
while (cin >> num)
a.push_back(num);
cout << a.size() << endl;
cin.clear(); //重置输入流,这里非常重要
while (a.size() % 2 != 0)
{
cout << "the number of the vector is odd, please add a more number" << endl;
cin >> num;
a.push_back(num);
}
for (auto temp : a)
{
cout << temp << " ";
}
cout << endl;
//print the sum of pair of adjacent elements
vector<int>::iterator it,it1,it2;
for (it = a.begin(); it != a.end(); it++)
{
int num1 = *it;
it++;
num1 += *it;
cout << num1 << " ";
}
cout << endl;
//print the sum of first and last elements,followed by the sum of the second and second-to-last,and so on
int count = 0;
for (it = a.begin(); it != a.begin() + a.size() / 2; it++)
{
int num2 = *it;
num2 += *(a.end() - 1 - count);
cout << num2 << " ";
count++;
}
return 0;
}