Odpowiedź:
#include <iostream>
#include <string>
using namespace std;
string text;
int main()
{
cout << "Wpisz wyraz:" << endl;
cin >> text;
int size = text.size();
if (size % 2 == 0)
for (int i = 0; i < size / 2; i++)
cout << text[i] << text[size - 1 - i];
else
for (int i = 0; i < size / 2; i++)
{
cout << text[i]<<text[size - 1 - i];
if(i==size/2-1)cout << text[size / 2];
}
}