#include <iostream>
#include <string>
#include <cmath>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string slovo = "shacnidw#", slovo_rez1 = "", slovo_rez2 = "";
for(int i = 0; i < (slovo.size()-1); i = i + 2){
slovo_rez1 = slovo_rez1 + slovo[i];
}
for(int i2 = slovo.size(); i2 > 0; i2 = i2 - 2){
slovo_rez2 = slovo_rez2 + slovo[i2];
}
cout << slovo_rez1 + slovo_rez2;
}
#include <iostream>
#include <string>
int main() {
using namespace std;
string str = "sand wich";
string str1;
string str2;
for (int i = 0; i < str.length();i++) {
if (str[i] == ' ') {
str1 = str.substr(0, i);
str2 = str.substr(i + 1, str.length());
break;
}
}
str = str1 + str2;
cout << str << endl;
getchar();
return 0;
}