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 num;
- cout << "Введите индекс символа: ";
- cin >> num;
- if (num < 0 || num >= strlen(line)) {
- cout << "Некорректный индекс" << endl;
- return 0;
- }
- for (int i = num; i < strlen(line); i++) {
- line[i] = line[i + 1];
- }
- cout << line;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement