Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <stdlib.h>
- using namespace std;
- int main()
- {
- char* str1=new char[12];
- char* str2=new char[10];
- char *temp1=new char[20];
- char* temp2 = new char[20];
- char* temp3 = new char[8];
- char* symbol = new char;
- int n;
- cout << "Enter str1: " << endl;
- cin >> str1;
- cout << "Enter str2: " << endl;
- cin >> str2;
- cout << "Enter symbol: " << endl;
- cin >> symbol;
- cout << "Enter n: " << endl;
- cin >> n;
- temp1 = _strrev(str1);
- temp1 = strstr(temp1, symbol);
- temp1 = _strrev(temp1); //здесь строка уже прямая с символом на конце
- temp2= _strrev(str2);
- temp2 = strtok(temp2, symbol);
- temp2=_strrev(str2);
- strncat(temp1, temp2, n);
- printf("%s", temp1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement