Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <string.h>
- using namespace std;
- int main() {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- char line[100];
- cout << "Введите строку: ";
- gets_s(line);
- int m, n;
- cout << "Введите m: ";
- cin >> m;
- cout << "Введите n: ";
- cin >> n;
- char* result = new char[strlen(line) - (n - m)];
- int k = 0;
- for (int i = 0; i < m; i++, k++) {
- result[k] = line[i];
- }
- for (int i = n + 1; i < strlen(line); i++, k++) {
- result[k] = line[i];
- }
- result[k] = '\0';
- cout << result << endl;
- delete[] result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement