Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstring>
- #include <windows.h>
- using namespace std;
- int main()
- {
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- ifstream file1("file1.txt");
- ofstream file2("file2.txt");
- if (!file1)
- {
- cout<<"Error";
- return 1;
- }
- else
- {
- string word;
- cout<<"Введите слово"<<endl;
- cin>>word;
- string line;
- while(!file1.eof())
- {
- getline(file1,line);
- if (line.find(word)==string::npos)
- file2<<line<<endl;
- }
- file2.close();
- file1.close();
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement