Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cstdio>
- using namespace std;
- int main(int argc, char* argv[])
- {
- setlocale(LC_ALL, "rus");
- char input[128] = "";
- char stop[] = "stop";
- char str[256];
- int l = 0;
- string file;
- char buff2[] = "\"){chat.close();}}}});";
- ifstream fin("script.txt"); //объявление строк и файлов
- fstream fout("script.txt");
- if (!fin.is_open()) // проверка
- {
- cout << "Файл не может быть открыт!\n";
- }
- getline(fin, file);
- if (l == 0)
- {
- for (int h = 1; h < 23; h++)
- {
- file[file.size() - h] = '\0';
- }
- fout << file;
- }
- b: cout << "Введите слово, которое будет пропускаться : ";
- cin.getline(input, 128);
- FILE * ptrFile = fopen("script.txt", "a+");
- int a = strcmp(stop, input);
- if ( a==0 ) //остановка программы
- {
- if (l > 0)
- {
- fputs(buff2, ptrFile);
- }
- return 0;
- }
- fseek(ptrFile, 22, SEEK_END);
- char buff[] = " || content == \""; // " || content == \"" + input + "\"){chat.close();}}}});";
- l = l+1;
- sprintf(str, "%s %s %s", buff, input, "\""); //Двач,в этом месте нужно,чтобы input был в "" ,но без пробелов (сейчас " input ")
- fputs(str, ptrFile);
- goto b;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement