Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void process2(const char* filein,const char* fileout) {
- string res,sentence,word;
- fin.open(filein);
- if (!fin) { cout << "Ошибка открытия файла в process"; exit(0); }
- rab.open(fileout,ios_base::app);
- if (!rab) { cout << "Ошибка открытия файла в process"; exit(0); }
- rab << "\n\n2 задание\n\n";
- while (!fin.eof()) {
- fin >> word;
- sentence.append(word + ' ');
- if (word[word.size() - 1] == '?') {
- res.append(sentence + ' ');
- sentence.clear();
- }
- else if (word[word.size() - 1] == '.') {
- sentence.clear();
- }
- }
- rab << res;
- fin.close();
- rab.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement