#include <string>
#include <iostream>
#include <limits>
using namespace std;
int main(int argc, char* argv[]) {
int n1;
int n2;
cout << "Input n1: ";
cin >> n1;
cout << "Input n2: ";
cin >> n2;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
const int buffer_size = 80;
char buffer[buffer_size];
cout << endl << "Input s1: ";
cin.getline(buffer, buffer_size);
string s1 = buffer;
cout << endl << "Input s2: ";
cin.getline(buffer, buffer_size);
string s2 = buffer;
cout << "n1 left symbols of s1 and n2 right symbols of s2:" << endl;
cout << s1.substr(0, n1) << s2.substr(s2.length() - n2, n2) << endl;
return 0;
}
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.